[mst-vhost:vhost 18/35] drivers/virtio/virtio_pci_modern.c:54:17: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'}

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
head:   185ec99c107fe7659a9d809bc7a8e7ab3c338bf9
commit: 37c82be3988d4cc710dee436d47cd80e792cab93 [18/35] virtio_pci: add check for common cfg size
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20231019/202310190338.ES0nNnf4-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310190338.ES0nNnf4-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310190338.ES0nNnf4-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/pci.h:37,
                    from drivers/virtio/virtio_pci_common.h:21,
                    from drivers/virtio/virtio_pci_modern.c:20:
   drivers/virtio/virtio_pci_modern.c: In function '__vp_check_common_size_one_feature':
>> drivers/virtio/virtio_pci_modern.c:54:17: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
      54 |                 "virtio: common cfg size(%ld) does not match the feature %s\n",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ^~~
   include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
     144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                        ^~~~~~~
   drivers/virtio/virtio_pci_modern.c:53:9: note: in expansion of macro 'dev_err'
      53 |         dev_err(&vdev->dev,
         |         ^~~~~~~
   drivers/virtio/virtio_pci_modern.c:54:44: note: format string is defined here
      54 |                 "virtio: common cfg size(%ld) does not match the feature %s\n",
         |                                          ~~^
         |                                            |
         |                                            long int
         |                                          %d


vim +54 drivers/virtio/virtio_pci_modern.c

  > 20	#include "virtio_pci_common.h"
    21	
    22	static u64 vp_get_features(struct virtio_device *vdev)
    23	{
    24		struct virtio_pci_device *vp_dev = to_vp_device(vdev);
    25	
    26		return vp_modern_get_features(&vp_dev->mdev);
    27	}
    28	
    29	static void vp_transport_features(struct virtio_device *vdev, u64 features)
    30	{
    31		struct virtio_pci_device *vp_dev = to_vp_device(vdev);
    32		struct pci_dev *pci_dev = vp_dev->pci_dev;
    33	
    34		if ((features & BIT_ULL(VIRTIO_F_SR_IOV)) &&
    35				pci_find_ext_capability(pci_dev, PCI_EXT_CAP_ID_SRIOV))
    36			__virtio_set_bit(vdev, VIRTIO_F_SR_IOV);
    37	
    38		if (features & BIT_ULL(VIRTIO_F_RING_RESET))
    39			__virtio_set_bit(vdev, VIRTIO_F_RING_RESET);
    40	}
    41	
    42	static int __vp_check_common_size_one_feature(struct virtio_device *vdev, u32 fbit,
    43						    u32 offset, const char *fname)
    44	{
    45		struct virtio_pci_device *vp_dev = to_vp_device(vdev);
    46	
    47		if (!__virtio_test_bit(vdev, fbit))
    48			return 0;
    49	
    50		if (likely(vp_dev->mdev.common_len >= offset))
    51			return 0;
    52	
    53		dev_err(&vdev->dev,
  > 54			"virtio: common cfg size(%ld) does not match the feature %s\n",
    55			vp_dev->mdev.common_len, fname);
    56	
    57		return -EINVAL;
    58	}
    59	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux