qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PULL 00/13] Net patches
Date: Mon, 30 Mar 2020 17:47:32 +0800	[thread overview]
Message-ID: <463a4d56-d843-a1a2-f078-b82c922730d9@redhat.com> (raw)
In-Reply-To: <CAFEAcA-u-vp6ETypJLTakc0bCTYfg7_9ONF6Za7GsmOtz6qXVQ@mail.gmail.com>


On 2020/3/27 下午7:36, Peter Maydell wrote:
> On Fri, 27 Mar 2020 at 11:14, Jason Wang <jasowang@redhat.com> wrote:
>> The following changes since commit cfe68ae025f704f336d7dd3d1903ce37b445831d:
>>
>>    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-03-26 20:55:54 +0000)
>>
>> are available in the git repository at:
>>
>>    https://github.com/jasowang/qemu.git tags/net-pull-request
>>
>> for you to fetch changes up to f3b364f4f77fcb24cec468f518bf5e093dc27cb7:
>>
>>    hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads (2020-03-27 18:59:47 +0800)
>>
>> ----------------------------------------------------------------
>>
>> ----------------------------------------------------------------
> Hi; this fails to compile (all platforms):


My bad, forget to run full docker test before sending the pull request.


>
> /home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
> error: initialization from incompatible pointer type
> [-Werror=incompatible-pointer-types]
>       .can_receive = allwinner_sun8i_emac_can_receive,
>                      ^
> /home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
> note: (near initialization for
> 'net_allwinner_sun8i_emac_info.can_receive')
>
>
> There's also this one, though not every compiler picked it up:
>
> /home/peter.maydell/qemu/hw/net/i82596.c: In function 'i82596_receive':
> /home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
> unsigned expression >= 0 is always true [-Werror=type-limits]
>                   assert(bufsz >= 0);
>                                ^
> /home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
> unsigned expression >= 0 is always true [-Werror=type-limits]
>                   assert(bufsz >= 0);
>                                ^
>
>
> For the first error, I think this needs squashing into
> "hw/net: Make NetCanReceive() return a boolean":
>
> diff --git a/hw/net/allwinner-sun8i-emac.c b/hw/net/allwinner-sun8i-emac.c
> index fc67a1be70..28637ff4c1 100644
> --- a/hw/net/allwinner-sun8i-emac.c
> +++ b/hw/net/allwinner-sun8i-emac.c
> @@ -395,7 +395,7 @@ static void
> allwinner_sun8i_emac_flush_desc(FrameDescriptor *desc,
>       cpu_physical_memory_write(phys_addr, desc, sizeof(*desc));
>   }
>
> -static int allwinner_sun8i_emac_can_receive(NetClientState *nc)
> +static bool allwinner_sun8i_emac_can_receive(NetClientState *nc)
>   {
>       AwSun8iEmacState *s = qemu_get_nic_opaque(nc);
>       FrameDescriptor desc;
>
>
> Squashing this into my
> "hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive()"
> commit fixes the second error.
>
> diff --git a/hw/net/i82596.c b/hw/net/i82596.c
> index a9bdbac339..055c3a1470 100644
> --- a/hw/net/i82596.c
> +++ b/hw/net/i82596.c
> @@ -653,8 +653,8 @@ ssize_t i82596_receive(NetClientState *nc, const
> uint8_t *buf, size_t sz)
>
>               if (bufcount > 0) {
>                   /* Still some of the actual data buffer to transfer */
> +                assert(bufsz >= bufcount);
>                   bufsz -= bufcount;
> -                assert(bufsz >= 0);
>                   address_space_write(&address_space_memory, rba,
>                                       MEMTXATTRS_UNSPECIFIED, buf, bufcount);
>                   rba += bufcount;
>
> thanks
> -- PMM
>

Right, will fix them.

Thanks




  reply	other threads:[~2020-03-30  9:48 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 11:13 [PULL 00/13] Net patches Jason Wang
2020-03-27 11:13 ` [PULL 01/13] hw/net/i82596: Correct command bitmask (CID 1419392) Jason Wang
2020-03-27 11:13 ` [PULL 02/13] hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive() Jason Wang
2020-03-27 11:13 ` [PULL 03/13] Fixed integer overflow in e1000e Jason Wang
2020-03-27 11:13 ` [PULL 04/13] hw/net/e1000e_core: Let e1000e_can_receive() return a boolean Jason Wang
2020-03-27 11:13 ` [PULL 05/13] hw/net/smc91c111: Let smc91c111_can_receive() " Jason Wang
2020-03-27 11:14 ` [PULL 06/13] hw/net/rtl8139: Simplify if/else statement Jason Wang
2020-03-27 11:14 ` [PULL 07/13] hw/net/rtl8139: Update coding style to make checkpatch.pl happy Jason Wang
2020-03-27 11:14 ` [PULL 08/13] hw/net: Make NetCanReceive() return a boolean Jason Wang
2020-03-27 11:14 ` [PULL 09/13] hw/net/can: Make CanBusClientInfo::can_receive() " Jason Wang
2020-03-27 11:14 ` [PULL 10/13] net/colo-compare.c: Expose "compare_timeout" to users Jason Wang
2020-03-27 11:14 ` [PULL 11/13] net/colo-compare.c: Expose "expired_scan_cycle" " Jason Wang
2020-03-27 11:14 ` [PULL 12/13] net: tulip: check frame size and r/w data length Jason Wang
2020-03-27 11:14 ` [PULL 13/13] hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads Jason Wang
2020-03-27 11:36 ` [PULL 00/13] Net patches Peter Maydell
2020-03-30  9:47   ` Jason Wang [this message]
2020-03-27 12:03 ` no-reply
2020-03-27 12:05 ` no-reply
  -- strict thread matches above, loose matches on Subject: below --
2021-03-22 10:07 Jason Wang
2021-03-22 14:13 ` Peter Maydell
2022-01-10  3:39 Jason Wang
2022-01-10 16:49 ` Peter Maydell
2022-01-11  2:09   ` Jason Wang
2022-01-11 22:02     ` Vladislav Yaroshchuk
2022-01-12  5:39       ` Jason Wang
2022-01-12  6:19         ` Vladislav Yaroshchuk
2022-01-12  7:49           ` Jason Wang
2022-01-12  7:10         ` Roman Bolshakov
2022-01-12  7:51           ` Jason Wang
2022-01-12 13:16             ` Vladislav Yaroshchuk
2025-07-14  5:34 Jason Wang
2025-07-15  4:13 ` Jason Wang
2025-07-15 19:50 ` Stefan Hajnoczi
2025-07-16  2:21   ` Jason Wang
2025-07-16  4:40     ` Philippe Mathieu-Daudé
2025-07-16 10:26     ` Stefan Hajnoczi
2025-07-16 10:30       ` Stefan Hajnoczi

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=463a4d56-d843-a1a2-f078-b82c922730d9@redhat.com \
    --to=jasowang@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).