[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 00/13] Net patches
From: |
Peter Maydell |
Subject: |
Re: [PULL 00/13] Net patches |
Date: |
Fri, 27 Mar 2020 11:36:41 +0000 |
On Fri, 27 Mar 2020 at 11:14, Jason Wang <address@hidden> 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):
/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
- [PULL 04/13] hw/net/e1000e_core: Let e1000e_can_receive() return a boolean, (continued)
- [PULL 04/13] hw/net/e1000e_core: Let e1000e_can_receive() return a boolean, Jason Wang, 2020/03/27
- [PULL 05/13] hw/net/smc91c111: Let smc91c111_can_receive() return a boolean, Jason Wang, 2020/03/27
- [PULL 06/13] hw/net/rtl8139: Simplify if/else statement, Jason Wang, 2020/03/27
- [PULL 07/13] hw/net/rtl8139: Update coding style to make checkpatch.pl happy, Jason Wang, 2020/03/27
- [PULL 08/13] hw/net: Make NetCanReceive() return a boolean, Jason Wang, 2020/03/27
- [PULL 09/13] hw/net/can: Make CanBusClientInfo::can_receive() return a boolean, Jason Wang, 2020/03/27
- [PULL 10/13] net/colo-compare.c: Expose "compare_timeout" to users, Jason Wang, 2020/03/27
- [PULL 11/13] net/colo-compare.c: Expose "expired_scan_cycle" to users, Jason Wang, 2020/03/27
- [PULL 12/13] net: tulip: check frame size and r/w data length, Jason Wang, 2020/03/27
- [PULL 13/13] hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads, Jason Wang, 2020/03/27
- Re: [PULL 00/13] Net patches,
Peter Maydell <=
- Re: [PULL 00/13] Net patches, no-reply, 2020/03/27
- Re: [PULL 00/13] Net patches, no-reply, 2020/03/27