qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH 4/4] hw/net/npcm_gmac.c: Drop 'buf' local variable
Date: Mon, 14 Jul 2025 22:06:56 +0200	[thread overview]
Message-ID: <9f73dd64-5fd9-4b92-b146-74e94408d437@linaro.org> (raw)
In-Reply-To: <20250714165523.1956235-5-peter.maydell@linaro.org>

On 14/7/25 18:55, Peter Maydell wrote:
> We use the local variable 'buf' only when we call dma_memory_read(),
> and it is always set to &tx_send_buffer[prev_buf_size] immediately
> before both of those calls.  So remove the variable and pass
> tx_send_buffer + prev_buf_size to dma_memory_read().
> 
> This fixes in passing a place where we set buf = tx_send_buffer
> but never used that value because we always updated buf to
> something else later before using it.
> 
> Coverity: CID 1534027
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/net/npcm_gmac.c | 12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



      reply	other threads:[~2025-07-14 21:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 16:55 [PATCH 0/4] hw/net/npcm_gmac: Various fixes to gmac_try_send_next_packet() Peter Maydell
2025-07-14 16:55 ` [PATCH 1/4] hw/net/npcm_gmac.c: Send the right data for second packet in a row Peter Maydell
2025-07-14 16:55 ` [PATCH 2/4] hw/net/npcm_gmac.c: Unify length and prev_buf_size variables Peter Maydell
2025-07-21 14:03   ` Peter Maydell
2025-07-14 16:55 ` [PATCH 3/4] hw/net/npcm_gmac.c: Correct test for when to reallocate packet buffer Peter Maydell
2025-07-14 20:08   ` Philippe Mathieu-Daudé
2025-07-15 22:23     ` Hao Wu
2025-07-14 16:55 ` [PATCH 4/4] hw/net/npcm_gmac.c: Drop 'buf' local variable Peter Maydell
2025-07-14 20:06   ` Philippe Mathieu-Daudé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f73dd64-5fd9-4b92-b146-74e94408d437@linaro.org \
    --to=philmd@linaro.org \
    --cc=jasowang@redhat.com \
    --cc=kfting@nuvoton.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wuhaotsh@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).