From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Finn Thain <fthain@telegraphics.com.au>,
Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Laurent Vivier" <laurent@vivier.eu>,
qemu-stable@nongnu.org
Subject: Re: [PATCH v3 04/14] dp8393x: Have dp8393x_receive() return the packet size
Date: Tue, 28 Jan 2020 12:03:31 +0100 [thread overview]
Message-ID: <b47b1144-bb76-9f70-3351-86ba605e4ac3@redhat.com> (raw)
In-Reply-To: <a582b4412af479e0830d1ef0005a91a98bfc56cc.1579474761.git.fthain@telegraphics.com.au>
On 1/19/20 11:59 PM, Finn Thain wrote:
> This function re-uses its 'size' argument as a scratch variable.
> Instead, declare a local 'size' variable for that purpose so that the
> function result doesn't get messed up.
>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Laurent Vivier <laurent@vivier.eu>
> ---
> hw/net/dp8393x.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
> index 2d2ace2549..ece72cbf42 100644
> --- a/hw/net/dp8393x.c
> +++ b/hw/net/dp8393x.c
> @@ -757,20 +757,21 @@ static int dp8393x_receive_filter(dp8393xState *s, const uint8_t * buf,
> }
>
> static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
> - size_t size)
> + size_t pkt_size)
> {
> dp8393xState *s = qemu_get_nic_opaque(nc);
> int packet_type;
> uint32_t available, address;
> - int width, rx_len = size;
> + int width, rx_len = pkt_size;
> uint32_t checksum;
> + int size;
>
> width = (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1;
>
> s->regs[SONIC_RCR] &= ~(SONIC_RCR_PRX | SONIC_RCR_LBK | SONIC_RCR_FAER |
> SONIC_RCR_CRCR | SONIC_RCR_LPKT | SONIC_RCR_BC | SONIC_RCR_MC);
>
> - packet_type = dp8393x_receive_filter(s, buf, size);
> + packet_type = dp8393x_receive_filter(s, buf, pkt_size);
> if (packet_type < 0) {
> DPRINTF("packet not for netcard\n");
> return -1;
> @@ -864,7 +865,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const uint8_t * buf,
> /* Done */
> dp8393x_update_irq(s);
>
> - return size;
> + return pkt_size;
> }
>
> static void dp8393x_reset(DeviceState *dev)
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2020-01-28 11:05 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-19 22:59 [PATCH v3 00/14] Fixes for DP8393X SONIC device emulation Finn Thain
2020-01-19 22:59 ` [PATCH v3 14/14] dp8393x: Don't stop reception upon RBE interrupt assertion Finn Thain
2020-01-19 22:59 ` [PATCH v3 03/14] dp8393x: Clean up endianness hacks Finn Thain
2020-01-28 11:02 ` Philippe Mathieu-Daudé
2020-01-19 22:59 ` [PATCH v3 13/14] dp8393x: Don't reset Silicon Revision register Finn Thain
2020-01-28 11:08 ` Philippe Mathieu-Daudé
2020-01-28 22:28 ` Finn Thain
2020-01-29 6:53 ` Philippe Mathieu-Daudé
2020-01-29 7:52 ` Finn Thain
2020-01-19 22:59 ` [PATCH v3 06/14] dp8393x: Clear RRRA command register bit only when appropriate Finn Thain
2020-01-19 22:59 ` [PATCH v3 09/14] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode Finn Thain
2020-01-28 11:13 ` Philippe Mathieu-Daudé
2020-01-19 22:59 ` [PATCH v3 11/14] dp8393x: Clear descriptor in_use field to release packet Finn Thain
2020-01-19 22:59 ` [PATCH v3 01/14] dp8393x: Mask EOL bit from descriptor addresses Finn Thain
2020-01-28 11:21 ` Philippe Mathieu-Daudé
2020-01-28 22:57 ` Finn Thain
2020-01-19 22:59 ` [PATCH v3 12/14] dp8393x: Always update RRA pointers and sequence numbers Finn Thain
2020-01-19 22:59 ` [PATCH v3 02/14] dp8393x: Always use 32-bit accesses Finn Thain
2020-01-19 22:59 ` [PATCH v3 05/14] dp8393x: Update LLFA and CRDA registers from rx descriptor Finn Thain
2020-01-19 22:59 ` [PATCH v3 08/14] dp8393x: Don't clobber packet checksum Finn Thain
2020-01-19 22:59 ` [PATCH v3 04/14] dp8393x: Have dp8393x_receive() return the packet size Finn Thain
2020-01-28 11:03 ` Philippe Mathieu-Daudé [this message]
2020-01-28 11:04 ` Philippe Mathieu-Daudé
2020-01-19 22:59 ` [PATCH v3 10/14] dp8393x: Pad frames to word or long word boundary Finn Thain
2020-01-28 11:02 ` Philippe Mathieu-Daudé
2020-01-19 22:59 ` [PATCH v3 07/14] dp8393x: Implement packet size limit and RBAE interrupt Finn Thain
2020-01-28 0:12 ` [PATCH v3 00/14] Fixes for DP8393X SONIC device emulation Laurent Vivier
2020-01-28 0:25 ` Finn Thain
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=b47b1144-bb76-9f70-3351-86ba605e4ac3@redhat.com \
--to=philmd@redhat.com \
--cc=aleksandar.rikalo@rt-rk.com \
--cc=fthain@telegraphics.com.au \
--cc=hpoussin@reactos.org \
--cc=jasowang@redhat.com \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/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).