* [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
@ 2019-08-09 7:25 Bin Meng
2019-08-10 1:57 ` Alistair Francis
0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2019-08-09 7:25 UTC (permalink / raw)
To: Alistair Francis, Edgar E. Iglesias, Jason Wang, Peter Maydell,
Stefano Garzarella, Philippe Mathieu-Daudé,
qemu-devel, qemu-arm
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.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
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(-)
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index d412085..e26ff98 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
2019-08-09 7:25 [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT() Bin Meng
@ 2019-08-10 1:57 ` Alistair Francis
2019-08-19 5:24 ` Bin Meng
0 siblings, 1 reply; 6+ messages in thread
From: Alistair Francis @ 2019-08-10 1:57 UTC (permalink / raw)
To: Bin Meng
Cc: Peter Maydell, Jason Wang, qemu-devel@nongnu.org Developers,
qemu-arm, Alistair Francis, Edgar E. Iglesias,
Philippe Mathieu-Daudé,
Stefano Garzarella
On Fri, Aug 9, 2019 at 12:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
>
> ---
>
> 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(-)
>
> diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> index d412085..e26ff98 100644
> --- a/hw/net/cadence_gem.c
> +++ b/hw/net/cadence_gem.c
> @@ -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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
2019-08-10 1:57 ` Alistair Francis
@ 2019-08-19 5:24 ` Bin Meng
2019-08-19 5:40 ` Jason Wang
0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2019-08-19 5:24 UTC (permalink / raw)
To: Alistair Francis
Cc: Peter Maydell, Jason Wang, qemu-devel@nongnu.org Developers,
qemu-arm, Alistair Francis, Edgar E. Iglesias,
Philippe Mathieu-Daudé,
Stefano Garzarella
On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Fri, Aug 9, 2019 at 12:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>
Ping?
What's the status of this patch?
Regards,
Bin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
2019-08-19 5:24 ` Bin Meng
@ 2019-08-19 5:40 ` Jason Wang
2020-02-13 9:39 ` Bin Meng
0 siblings, 1 reply; 6+ messages in thread
From: Jason Wang @ 2019-08-19 5:40 UTC (permalink / raw)
To: Bin Meng, Alistair Francis
Cc: Peter Maydell, qemu-devel@nongnu.org Developers, qemu-arm,
Alistair Francis, Edgar E. Iglesias, Philippe Mathieu-Daudé,
Stefano Garzarella
On 2019/8/19 下午1:24, Bin Meng wrote:
> On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis <alistair23@gmail.com> wrote:
>> On Fri, Aug 9, 2019 at 12:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>>> 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.
>>>
>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>>
> Ping?
>
> What's the status of this patch?
>
> Regards,
> Bin
Applied.
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
2019-08-19 5:40 ` Jason Wang
@ 2020-02-13 9:39 ` Bin Meng
2020-02-13 9:42 ` Jason Wang
0 siblings, 1 reply; 6+ messages in thread
From: Bin Meng @ 2020-02-13 9:39 UTC (permalink / raw)
To: Jason Wang
Cc: Peter Maydell, qemu-devel@nongnu.org Developers, qemu-arm,
Alistair Francis, Edgar E. Iglesias, Alistair Francis,
Philippe Mathieu-Daudé,
Stefano Garzarella
Hi Jason,
On Mon, Aug 19, 2019 at 1:40 PM Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 2019/8/19 下午1:24, Bin Meng wrote:
> > On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis <alistair23@gmail.com> wrote:
> >> On Fri, Aug 9, 2019 at 12:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> >>> 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.
> >>>
> >>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> >> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> >>
> > Ping?
> >
> > What's the status of this patch?
> >
> > Regards,
> > Bin
>
>
> Applied.
I checked latest qemu/master and found this patch isn't applied. Could
you please take a look?
Regards,
Bin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()
2020-02-13 9:39 ` Bin Meng
@ 2020-02-13 9:42 ` Jason Wang
0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2020-02-13 9:42 UTC (permalink / raw)
To: Bin Meng
Cc: Peter Maydell, qemu-devel@nongnu.org Developers, qemu-arm,
Alistair Francis, Edgar E. Iglesias, Alistair Francis,
Philippe Mathieu-Daudé,
Stefano Garzarella
On 2020/2/13 下午5:39, Bin Meng wrote:
> Hi Jason,
>
> On Mon, Aug 19, 2019 at 1:40 PM Jason Wang <jasowang@redhat.com> wrote:
>>
>> On 2019/8/19 下午1:24, Bin Meng wrote:
>>> On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis <alistair23@gmail.com> wrote:
>>>> On Fri, Aug 9, 2019 at 12:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>> 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.
>>>>>
>>>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>>>>
>>> Ping?
>>>
>>> What's the status of this patch?
>>>
>>> Regards,
>>> Bin
>>
>> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-02-13 9:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 7:25 [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT() Bin Meng
2019-08-10 1:57 ` Alistair Francis
2019-08-19 5:24 ` Bin Meng
2019-08-19 5:40 ` Jason Wang
2020-02-13 9:39 ` Bin Meng
2020-02-13 9:42 ` Jason Wang
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).