[dpdk-dev] [PATCH v5 2/2] virtio: fix PCI config err handling

Luca Boccassi bluca at debian.org
Tue Aug 28 12:14:21 CEST 2018


On Tue, 2018-08-28 at 14:43 +0800, Tiwei Bie wrote:
> I just noticed the title. It should be "net/virtio: xxx",
> instead of "virtio: xxx".

Fixed

> On Mon, Aug 27, 2018 at 05:52:40PM +0100, Luca Boccassi wrote:
> [...]
> > +			ret = rte_pci_read_config(dev, &flags,
> > sizeof(flags),
> > +					pos + sizeof(cap));
> > +			if (ret != sizeof(flags)) {
> > +				PMD_INIT_LOG(DEBUG,
> > +					     "failed to read pci
> > cap at pos:"
> > +					     " %lx ret %d", pos +
> > sizeof(cap),
> > +					     ret);
> 
> In file included from drivers/net/virtio/virtio_pci.c:15:0:
> drivers/net/virtio/virtio_pci.c: In function ‘vtpci_msix_detect’:
> drivers/net/virtio/virtio_logs.h:13:3: error: format ‘%lx’ expects
> argument of type ‘long unsigned int’, but argument 5 has type
> ‘unsigned int’ [-Werror=format=]
>    "%s(): " fmt "\n", __func__, ##args)
>    ^
> drivers/net/virtio/virtio_pci.c:737:5: note: in expansion of macro
> ‘PMD_INIT_LOG’
>      PMD_INIT_LOG(DEBUG,
>      ^
> cc1: all warnings being treated as errors
> 
> I got above build issues in 32bit build.
> 
> 
> Apart from that,
> 
> Reviewed-by: Tiwei Bie <tiwei.bie at intel.com>
> 
> Thanks!

So the 32 and 64 bit builds want opposite things, due to the sizeof
type. I changed it to avoid sizeof and just calculate it like in every
other prints of these functions to avoid the issue.

-- 
Kind regards,
Luca Boccassi


More information about the dev mailing list