hw: net: cadence_gem: Fix build errors in DB_PRINT()
PATCH v3 1/1 hw: net: cadence_gem: Fix build errors in DB_PRINT()
When CADENCE_GEM_ERR_DEBUG is turned on, there are several compilation errors in DB_PRINT(). Fix them.
While we are here, update to use appropriate modifiers in the same DB_PRINT() call.
---
Changes in v3:
- use PRIx64 as rx_desc_get_buffer() returns uint64_t
- use %u for unsigned
- remove unnecessary cast in DB_PRINT()
Changes in v2:
- use HWADDR_PRIx instead of TARGET_FMT_plx for consistency
- use 'z' modifier to print sizeof(..)
hw/net/cadence_gem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hw/net/cadence_gem.c +6 -5
@@ -983,8 +983,9 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size)return -1 ; } -DB_PRINT ("copy %d bytes to 0x%x\n" ,MIN (bytes_to_copy, rxbufsize), -rx_desc_get_buffer (s->rx_desc[q])); +DB_PRINT ("copy %u bytes to 0x%" PRIx64"\n" , +MIN (bytes_to_copy, rxbufsize), +rx_desc_get_buffer (s, s->rx_desc[q]));/* Copy packet data to emulated DMA buffer */ address_space_write(&s->dma_as, rx_desc_get_buffer(s, s->rx_desc[q]) +
@@ -1156,9 +1157,9 @@ static void gem_transmit(CadenceGEMState *s)if (tx_desc_get_length (desc) >sizeof (tx_packet) - (p - tx_packet)) { -DB_PRINT ("TX descriptor @ 0x%x too large: size 0x%x space " \ -"0x%x\n" , (unsigned )packet_desc_addr, - (unsigned )tx_desc_get_length (desc), +DB_PRINT ("TX descriptor @ 0x%" HWADDR_PRIx \ +" too large: size 0x%x space 0x%zx\n" , + packet_desc_addr,tx_desc_get_length (desc),sizeof (tx_packet) - (p - tx_packet));break ; }
Signature · 1 line
2.7.4
Quoted 8 lines · Bin Meng
When
CADENCE_GEM_ERR_DEBUGis turned on, there are several compilation errors inDB_PRINT(). Fix them.While we are here, update to use appropriate modifiers in the same
DB_PRINT()call.Signed-off-by Bin Meng <[email protected]>
Alistair
Quoted 48 lines
---
Changes in v3:
- use PRIx64 asrx_desc_get_buffer()returnsuint64_t
- use %u for unsigned
- remove unnecessary cast inDB_PRINT()Changes in v2:
- useHWADDR_PRIxinstead ofTARGET_FMT_plxfor consistency
- use 'z' modifier to print sizeof(..)hw/net/cadence_gem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)hw/net/cadence_gem.c +6
-6@@ -983,8 +983,9 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size)return -1 ; } -DB_PRINT ("copy %d bytes to 0x%x\n" ,MIN (bytes_to_copy, rxbufsize), -rx_desc_get_buffer (s->rx_desc[q])); +DB_PRINT ("copy %u bytes to 0x%" PRIx64"\n" , +MIN (bytes_to_copy, rxbufsize), +rx_desc_get_buffer (s, s->rx_desc[q]));/* Copy packet data to emulated DMA buffer */ address_space_write(&s->dma_as, rx_desc_get_buffer(s, s->rx_desc[q]) +@@ -1156,9 +1157,9 @@ static void gem_transmit(CadenceGEMState *s)if (tx_desc_get_length (desc) >sizeof (tx_packet) - (p - tx_packet)) { -DB_PRINT ("TX descriptor @ 0x%x too large: size 0x%x space " \ -"0x%x\n" , (unsigned )packet_desc_addr, - (unsigned )tx_desc_get_length (desc), +DB_PRINT ("TX descriptor @ 0x%" HWADDR_PRIx \ +" too large: size 0x%x space 0x%zx\n" , + packet_desc_addr,tx_desc_get_length (desc),sizeof (tx_packet) - (p - tx_packet));break ; } --2.7.4
Quoted 6 lines · Alistair Francis
Quoted 4 lines · Bin Meng
When
CADENCE_GEM_ERR_DEBUGis turned on, there are several compilation errors inDB_PRINT(). Fix them.
Quoted 7 lines
Quoted 4 lines
While we are here, update to use appropriate modifiers in the same
DB_PRINT()call.Signed-off-by Bin Meng <[email protected]>Reviewed-by Alistair Francis <[email protected]>
Ping?
What's the status of this patch?
Regards,
Bin
Jason Wang
AppliedQuoted 9 lines · Bin Meng
Quoted 8 lines · Alistair Francis
Quoted 7 lines · Bin Meng
When
CADENCE_GEM_ERR_DEBUGis turned on, there are several compilation errors inDB_PRINT(). Fix them.While we are here, update to use appropriate modifiers in the same
DB_PRINT()call.Signed-off-by Bin Meng <[email protected]>
Quoted 8 lines
Quoted 2 lines
Reviewed-by Alistair Francis <[email protected]>Ping?
What's the status of this patch?
Regards,
Bin
Applied.
Thanks
Hi Jason,
Quoted 16 lines · Jason Wang
Quoted 13 lines · Bin Meng
Quoted 10 lines · Alistair Francis
Quoted 7 lines · Bin Meng
When
CADENCE_GEM_ERR_DEBUGis turned on, there are several compilation errors inDB_PRINT(). Fix them.While we are here, update to use appropriate modifiers in the same
DB_PRINT()call.Signed-off-by Bin Meng <[email protected]>Reviewed-by Alistair Francis <[email protected]>Ping?
Quoted 7 lines
Quoted 4 lines
What's the status of this patch?
Regards,
BinApplied.
I checked latest qemu/master and found this patch isn't applied. Could you please take a look?
Regards,
Bin
Quoted 23 lines · Bin Meng
Hi Jason,
Quoted 20 lines · Jason Wang
Quoted 17 lines · Bin Meng
Quoted 10 lines · Alistair Francis
Quoted 7 lines · Bin Meng
When
CADENCE_GEM_ERR_DEBUGis turned on, there are several compilation errors inDB_PRINT(). Fix them.While we are here, update to use appropriate modifiers in the same
DB_PRINT()call.Signed-off-by Bin Meng <[email protected]>Reviewed-by Alistair Francis <[email protected]>Ping?
What's the status of this patch?
Regards,
Bin
Quoted 6 lines
Quoted 1 line
Applied.
I checked latest qemu/master and found this patch isn't applied. Could you please take a look?
Regards,
Bin
For some unknown reason it was lost, I've applied in my tree and it will be in the next pull request.
Sorry.