qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] net: cadence_gem: fix compilation error when


From: Ramon Fried
Subject: Re: [Qemu-devel] [PATCH v2] net: cadence_gem: fix compilation error when debug is on
Date: Wed, 12 Jun 2019 07:27:08 +0300

On Tue, Jun 11, 2019 at 7:21 PM Laurent Vivier <address@hidden> wrote:

> Le 11/06/2019 à 16:55, Ramon Fried a écrit :
> > defining CADENCE_GEM_ERR_DEBUG causes compilation
> > errors, fix that.
> >
> > Signed-off-by: Ramon Fried <address@hidden>
> > ---
> > v2: change %lx to HWADDR_PRIx and %lx to %zdx
>
> HWADDR_PRIx is to use with hwaddr type (packet_desc_addr).
> rx_desc_get_buffer() is uint64_t, you must use PRIx64.
> It may be better to remove also the cast to unsigned.
>
Other places in the code also use HWADDR_PRIx with  rx_desc_get_buffer().
Should I change them also ?

>
> Thanks,
> Laurent
> >
> >  hw/net/cadence_gem.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> > index 7f63411430..e9b1b1e2eb 100644
> > --- a/hw/net/cadence_gem.c
> > +++ b/hw/net/cadence_gem.c
> > @@ -982,8 +982,8 @@ 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 %d bytes to 0x%" HWADDR_PRIx "\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,7 +1156,7 @@ 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,
> > +                         "0x%zdx\n", (unsigned)packet_desc_addr,
> >                           (unsigned)tx_desc_get_length(desc),
> >                           sizeof(tx_packet) - (p - tx_packet));
> >                  break;
> >
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]