LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
@ 2021-11-25  7:03 Dan Carpenter
  2021-11-25 16:15 ` Michael S. Tsirkin
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2021-11-25  7:03 UTC (permalink / raw)
  To: kbuild, Parav Pandit
  Cc: lkp, kbuild-all, linux-kernel, Michael S. Tsirkin, Eli Cohen,
	Jason Wang, Eric Dumazet

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5d9f4cf36721aba199975a9be7863a3ff5cd4b59
commit: 33b347503f014ebf76257327cbc7001c6b721956 vdpa: Define vdpa mgmt device, ops and a netlink interface
config: i386-randconfig-m021-20211118 (https://download.01.org/0day-ci/archive/20211125/202111250317.VUsGtdox-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?

vim +296 drivers/vdpa/vdpa.c

33b347503f014eb Parav Pandit 2021-01-05  280  static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *msg,
33b347503f014eb Parav Pandit 2021-01-05  281  			     u32 portid, u32 seq, int flags)
33b347503f014eb Parav Pandit 2021-01-05  282  {
33b347503f014eb Parav Pandit 2021-01-05  283  	u64 supported_classes = 0;
                                                ^^^^^^^^^^^^^^^^^^^^^
This is a u64

33b347503f014eb Parav Pandit 2021-01-05  284  	void *hdr;
33b347503f014eb Parav Pandit 2021-01-05  285  	int i = 0;
33b347503f014eb Parav Pandit 2021-01-05  286  	int err;
33b347503f014eb Parav Pandit 2021-01-05  287  
33b347503f014eb Parav Pandit 2021-01-05  288  	hdr = genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags, VDPA_CMD_MGMTDEV_NEW);
33b347503f014eb Parav Pandit 2021-01-05  289  	if (!hdr)
33b347503f014eb Parav Pandit 2021-01-05  290  		return -EMSGSIZE;
33b347503f014eb Parav Pandit 2021-01-05  291  	err = vdpa_nl_mgmtdev_handle_fill(msg, mdev);
33b347503f014eb Parav Pandit 2021-01-05  292  	if (err)
33b347503f014eb Parav Pandit 2021-01-05  293  		goto msg_err;
33b347503f014eb Parav Pandit 2021-01-05  294  
33b347503f014eb Parav Pandit 2021-01-05  295  	while (mdev->id_table[i].device) {
33b347503f014eb Parav Pandit 2021-01-05 @296  		supported_classes |= BIT(mdev->id_table[i].device);

Which suggests that this should be BIT_ULL().

33b347503f014eb Parav Pandit 2021-01-05  297  		i++;
33b347503f014eb Parav Pandit 2021-01-05  298  	}
33b347503f014eb Parav Pandit 2021-01-05  299  
33b347503f014eb Parav Pandit 2021-01-05  300  	if (nla_put_u64_64bit(msg, VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES,
33b347503f014eb Parav Pandit 2021-01-05  301  			      supported_classes, VDPA_ATTR_UNSPEC)) {
33b347503f014eb Parav Pandit 2021-01-05  302  		err = -EMSGSIZE;
33b347503f014eb Parav Pandit 2021-01-05  303  		goto msg_err;
33b347503f014eb Parav Pandit 2021-01-05  304  	}
33b347503f014eb Parav Pandit 2021-01-05  305  
33b347503f014eb Parav Pandit 2021-01-05  306  	genlmsg_end(msg, hdr);
33b347503f014eb Parav Pandit 2021-01-05  307  	return 0;
33b347503f014eb Parav Pandit 2021-01-05  308  
33b347503f014eb Parav Pandit 2021-01-05  309  msg_err:
33b347503f014eb Parav Pandit 2021-01-05  310  	genlmsg_cancel(msg, hdr);
33b347503f014eb Parav Pandit 2021-01-05  311  	return err;
33b347503f014eb Parav Pandit 2021-01-05  312  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
  2021-11-25  7:03 drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type? Dan Carpenter
@ 2021-11-25 16:15 ` Michael S. Tsirkin
  2021-11-25 16:52   ` Joe Perches
  2021-11-25 17:39   ` Parav Pandit
  0 siblings, 2 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2021-11-25 16:15 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kbuild, Parav Pandit, lkp, kbuild-all, linux-kernel, Eli Cohen,
	Jason Wang, Eric Dumazet

On Thu, Nov 25, 2021 at 10:03:28AM +0300, Dan Carpenter wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   5d9f4cf36721aba199975a9be7863a3ff5cd4b59
> commit: 33b347503f014ebf76257327cbc7001c6b721956 vdpa: Define vdpa mgmt device, ops and a netlink interface
> config: i386-randconfig-m021-20211118 (https://download.01.org/0day-ci/archive/20211125/202111250317.VUsGtdox-lkp@intel.com/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> smatch warnings:
> drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
> 
> vim +296 drivers/vdpa/vdpa.c
> 
> 33b347503f014eb Parav Pandit 2021-01-05  280  static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *msg,
> 33b347503f014eb Parav Pandit 2021-01-05  281  			     u32 portid, u32 seq, int flags)
> 33b347503f014eb Parav Pandit 2021-01-05  282  {
> 33b347503f014eb Parav Pandit 2021-01-05  283  	u64 supported_classes = 0;
>                                                 ^^^^^^^^^^^^^^^^^^^^^
> This is a u64
> 
> 33b347503f014eb Parav Pandit 2021-01-05  284  	void *hdr;
> 33b347503f014eb Parav Pandit 2021-01-05  285  	int i = 0;
> 33b347503f014eb Parav Pandit 2021-01-05  286  	int err;
> 33b347503f014eb Parav Pandit 2021-01-05  287  
> 33b347503f014eb Parav Pandit 2021-01-05  288  	hdr = genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags, VDPA_CMD_MGMTDEV_NEW);
> 33b347503f014eb Parav Pandit 2021-01-05  289  	if (!hdr)
> 33b347503f014eb Parav Pandit 2021-01-05  290  		return -EMSGSIZE;
> 33b347503f014eb Parav Pandit 2021-01-05  291  	err = vdpa_nl_mgmtdev_handle_fill(msg, mdev);
> 33b347503f014eb Parav Pandit 2021-01-05  292  	if (err)
> 33b347503f014eb Parav Pandit 2021-01-05  293  		goto msg_err;
> 33b347503f014eb Parav Pandit 2021-01-05  294  
> 33b347503f014eb Parav Pandit 2021-01-05  295  	while (mdev->id_table[i].device) {
> 33b347503f014eb Parav Pandit 2021-01-05 @296  		supported_classes |= BIT(mdev->id_table[i].device);
> 
> Which suggests that this should be BIT_ULL().
> 
> 33b347503f014eb Parav Pandit 2021-01-05  297  		i++;
> 33b347503f014eb Parav Pandit 2021-01-05  298  	}
> 33b347503f014eb Parav Pandit 2021-01-05  299  
> 33b347503f014eb Parav Pandit 2021-01-05  300  	if (nla_put_u64_64bit(msg, VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES,
> 33b347503f014eb Parav Pandit 2021-01-05  301  			      supported_classes, VDPA_ATTR_UNSPEC)) {
> 33b347503f014eb Parav Pandit 2021-01-05  302  		err = -EMSGSIZE;
> 33b347503f014eb Parav Pandit 2021-01-05  303  		goto msg_err;
> 33b347503f014eb Parav Pandit 2021-01-05  304  	}
> 33b347503f014eb Parav Pandit 2021-01-05  305  
> 33b347503f014eb Parav Pandit 2021-01-05  306  	genlmsg_end(msg, hdr);
> 33b347503f014eb Parav Pandit 2021-01-05  307  	return 0;
> 33b347503f014eb Parav Pandit 2021-01-05  308  
> 33b347503f014eb Parav Pandit 2021-01-05  309  msg_err:
> 33b347503f014eb Parav Pandit 2021-01-05  310  	genlmsg_cancel(msg, hdr);
> 33b347503f014eb Parav Pandit 2021-01-05  311  	return err;
> 33b347503f014eb Parav Pandit 2021-01-05  312  }


Parav? Any patches for this one?

> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
  2021-11-25 16:15 ` Michael S. Tsirkin
@ 2021-11-25 16:52   ` Joe Perches
  2021-11-25 17:33     ` Parav Pandit
  2021-11-25 17:39   ` Parav Pandit
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2021-11-25 16:52 UTC (permalink / raw)
  To: Michael S. Tsirkin, Dan Carpenter
  Cc: kbuild, Parav Pandit, lkp, kbuild-all, linux-kernel, Eli Cohen,
	Jason Wang, Eric Dumazet

On Thu, 2021-11-25 at 11:15 -0500, Michael S. Tsirkin wrote:
> On Thu, Nov 25, 2021 at 10:03:28AM +0300, Dan Carpenter wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   5d9f4cf36721aba199975a9be7863a3ff5cd4b59
> > commit: 33b347503f014ebf76257327cbc7001c6b721956 vdpa: Define vdpa mgmt device, ops and a netlink interface
> > config: i386-randconfig-m021-20211118 (https://download.01.org/0day-ci/archive/20211125/202111250317.VUsGtdox-lkp@intel.com/config)
> > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > smatch warnings:
> > drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
> > 
> > vim +296 drivers/vdpa/vdpa.c
> > 
> > 33b347503f014eb Parav Pandit 2021-01-05  280  static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *msg,
> > 33b347503f014eb Parav Pandit 2021-01-05  281  			     u32 portid, u32 seq, int flags)
> > 33b347503f014eb Parav Pandit 2021-01-05  282  {
> > 33b347503f014eb Parav Pandit 2021-01-05  283  	u64 supported_classes = 0;
> >                                                 ^^^^^^^^^^^^^^^^^^^^^
> > This is a u64
> > 
> > 33b347503f014eb Parav Pandit 2021-01-05  284  	void *hdr;
> > 33b347503f014eb Parav Pandit 2021-01-05  285  	int i = 0;
> > 33b347503f014eb Parav Pandit 2021-01-05  286  	int err;
> > 33b347503f014eb Parav Pandit 2021-01-05  287  
> > 33b347503f014eb Parav Pandit 2021-01-05  288  	hdr = genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags, VDPA_CMD_MGMTDEV_NEW);
> > 33b347503f014eb Parav Pandit 2021-01-05  289  	if (!hdr)
> > 33b347503f014eb Parav Pandit 2021-01-05  290  		return -EMSGSIZE;
> > 33b347503f014eb Parav Pandit 2021-01-05  291  	err = vdpa_nl_mgmtdev_handle_fill(msg, mdev);
> > 33b347503f014eb Parav Pandit 2021-01-05  292  	if (err)
> > 33b347503f014eb Parav Pandit 2021-01-05  293  		goto msg_err;
> > 33b347503f014eb Parav Pandit 2021-01-05  294  
> > 33b347503f014eb Parav Pandit 2021-01-05  295  	while (mdev->id_table[i].device) {
> > 33b347503f014eb Parav Pandit 2021-01-05 @296  		supported_classes |= BIT(mdev->id_table[i].device);
> > 
> > Which suggests that this should be BIT_ULL().

True but it seems all of these tables have only 1 or
at most 3 non-null terminated entries.

It looks as if mdev->id_table itself could be NULL though:

drivers/vdpa/virtio_pci/vp_vdpa.c:      .id_table       = NULL, /* only dynamic ids */

which _might_ cause a null dereference.  Dunno if that's possible.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
  2021-11-25 16:52   ` Joe Perches
@ 2021-11-25 17:33     ` Parav Pandit
  0 siblings, 0 replies; 5+ messages in thread
From: Parav Pandit @ 2021-11-25 17:33 UTC (permalink / raw)
  To: Joe Perches, Michael S. Tsirkin, Dan Carpenter
  Cc: kbuild, lkp, kbuild-all, linux-kernel, Eli Cohen, Jason Wang,
	Eric Dumazet

Hi Joe,

> From: Joe Perches <joe@perches.com>
> Sent: Thursday, November 25, 2021 10:23 PM
> 
> On Thu, 2021-11-25 at 11:15 -0500, Michael S. Tsirkin wrote:
> > On Thu, Nov 25, 2021 at 10:03:28AM +0300, Dan Carpenter wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> > > head:   5d9f4cf36721aba199975a9be7863a3ff5cd4b59
> > > commit: 33b347503f014ebf76257327cbc7001c6b721956 vdpa: Define vdpa
> > > mgmt device, ops and a netlink interface
> > > config: i386-randconfig-m021-20211118
> > > (https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fd
> > > ownload.01.org%2F0day-
> ci%2Farchive%2F20211125%2F202111250317.VUsGtdo
> > > x-
> lkp%40intel.com%2Fconfig&amp;data=04%7C01%7Cparav%40nvidia.com%7Cf
> > >
> 4d5aa1e5dfe431788f908d9b03408a1%7C43083d15727340c1b7db39efd9ccc17
> a%7
> > >
> C0%7C0%7C637734559803525095%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAw
> > >
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sda
> ta=
> > >
> 0XNeoKTYFnhqSH7Zc3MEVYoz00Ox2XAwrRSShA9XpdM%3D&amp;reserved=0
> )
> > > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> > >
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > >
> > > smatch warnings:
> > > drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) <<
> (mdev->id_table[i]->device)' be a 64 bit type?
> > >
> > > vim +296 drivers/vdpa/vdpa.c
> > >
> > > 33b347503f014eb Parav Pandit 2021-01-05  280  static int
> vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *msg,
> > > 33b347503f014eb Parav Pandit 2021-01-05  281  			     u32
> portid, u32 seq, int flags)
> > > 33b347503f014eb Parav Pandit 2021-01-05  282  {
> > > 33b347503f014eb Parav Pandit 2021-01-05  283  	u64
> supported_classes = 0;
> > >
> > > ^^^^^^^^^^^^^^^^^^^^^ This is a u64
> > >
> > > 33b347503f014eb Parav Pandit 2021-01-05  284  	void *hdr;
> > > 33b347503f014eb Parav Pandit 2021-01-05  285  	int i = 0;
> > > 33b347503f014eb Parav Pandit 2021-01-05  286  	int err;
> > > 33b347503f014eb Parav Pandit 2021-01-05  287
> > > 33b347503f014eb Parav Pandit 2021-01-05  288  	hdr =
> genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags,
> VDPA_CMD_MGMTDEV_NEW);
> > > 33b347503f014eb Parav Pandit 2021-01-05  289  	if (!hdr)
> > > 33b347503f014eb Parav Pandit 2021-01-05  290  		return -
> EMSGSIZE;
> > > 33b347503f014eb Parav Pandit 2021-01-05  291  	err =
> vdpa_nl_mgmtdev_handle_fill(msg, mdev);
> > > 33b347503f014eb Parav Pandit 2021-01-05  292  	if (err)
> > > 33b347503f014eb Parav Pandit 2021-01-05  293  		goto msg_err;
> > > 33b347503f014eb Parav Pandit 2021-01-05  294
> > > 33b347503f014eb Parav Pandit 2021-01-05  295  	while (mdev-
> >id_table[i].device) {
> > > 33b347503f014eb Parav Pandit 2021-01-05 @296
> 	supported_classes |= BIT(mdev->id_table[i].device);
> > >
> > > Which suggests that this should be BIT_ULL().
>
I will respond to this part in reply to Michael.
 
> True but it seems all of these tables have only 1 or at most 3 non-null
> terminated entries.
> 
> It looks as if mdev->id_table itself could be NULL though:
> 
> drivers/vdpa/virtio_pci/vp_vdpa.c:      .id_table       = NULL, /* only dynamic ids
> */
> 
Below is not possible, because above id_table is for the PCI driver table and above id_table is per mgmt device for id table type struct virtio_device_id.

> which _might_ cause a null dereference.  Dunno if that's possible.
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type?
  2021-11-25 16:15 ` Michael S. Tsirkin
  2021-11-25 16:52   ` Joe Perches
@ 2021-11-25 17:39   ` Parav Pandit
  1 sibling, 0 replies; 5+ messages in thread
From: Parav Pandit @ 2021-11-25 17:39 UTC (permalink / raw)
  To: Michael S. Tsirkin, Dan Carpenter
  Cc: kbuild, lkp, kbuild-all, linux-kernel, Eli Cohen, Jason Wang,
	Eric Dumazet



> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Thursday, November 25, 2021 9:46 PM
> 
> On Thu, Nov 25, 2021 at 10:03:28AM +0300, Dan Carpenter wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> > head:   5d9f4cf36721aba199975a9be7863a3ff5cd4b59
> > commit: 33b347503f014ebf76257327cbc7001c6b721956 vdpa: Define vdpa
> > mgmt device, ops and a netlink interface
> > config: i386-randconfig-m021-20211118
> > (https://download.01.org/0day-
> ci/archive/20211125/202111250317.VUsGtdo
> > x-lkp@intel.com/config)
> > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > smatch warnings:
> > drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev-
> >id_table[i]->device)' be a 64 bit type?
> >
> > vim +296 drivers/vdpa/vdpa.c
> >
> > 33b347503f014eb Parav Pandit 2021-01-05  280  static int
> vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *msg,
> > 33b347503f014eb Parav Pandit 2021-01-05  281  			     u32
> portid, u32 seq, int flags)
> > 33b347503f014eb Parav Pandit 2021-01-05  282  {
> > 33b347503f014eb Parav Pandit 2021-01-05  283  	u64
> supported_classes = 0;
> >                                                 ^^^^^^^^^^^^^^^^^^^^^
> > This is a u64
> >
> > 33b347503f014eb Parav Pandit 2021-01-05  284  	void *hdr;
> > 33b347503f014eb Parav Pandit 2021-01-05  285  	int i = 0;
> > 33b347503f014eb Parav Pandit 2021-01-05  286  	int err;
> > 33b347503f014eb Parav Pandit 2021-01-05  287
> > 33b347503f014eb Parav Pandit 2021-01-05  288  	hdr =
> genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags,
> VDPA_CMD_MGMTDEV_NEW);
> > 33b347503f014eb Parav Pandit 2021-01-05  289  	if (!hdr)
> > 33b347503f014eb Parav Pandit 2021-01-05  290  		return -
> EMSGSIZE;
> > 33b347503f014eb Parav Pandit 2021-01-05  291  	err =
> vdpa_nl_mgmtdev_handle_fill(msg, mdev);
> > 33b347503f014eb Parav Pandit 2021-01-05  292  	if (err)
> > 33b347503f014eb Parav Pandit 2021-01-05  293  		goto msg_err;
> > 33b347503f014eb Parav Pandit 2021-01-05  294
> > 33b347503f014eb Parav Pandit 2021-01-05  295  	while (mdev-
> >id_table[i].device) {
> > 33b347503f014eb Parav Pandit 2021-01-05 @296
> 	supported_classes |= BIT(mdev->id_table[i].device);
> >
> > Which suggests that this should be BIT_ULL().
> >
> > 33b347503f014eb Parav Pandit 2021-01-05  297  		i++;
> > 33b347503f014eb Parav Pandit 2021-01-05  298  	}
> > 33b347503f014eb Parav Pandit 2021-01-05  299
> > 33b347503f014eb Parav Pandit 2021-01-05  300  	if
> (nla_put_u64_64bit(msg, VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES,
> > 33b347503f014eb Parav Pandit 2021-01-05  301
> supported_classes, VDPA_ATTR_UNSPEC)) {
> > 33b347503f014eb Parav Pandit 2021-01-05  302  		err = -
> EMSGSIZE;
> > 33b347503f014eb Parav Pandit 2021-01-05  303  		goto msg_err;
> > 33b347503f014eb Parav Pandit 2021-01-05  304  	}
> > 33b347503f014eb Parav Pandit 2021-01-05  305
> > 33b347503f014eb Parav Pandit 2021-01-05  306  	genlmsg_end(msg,
> hdr);
> > 33b347503f014eb Parav Pandit 2021-01-05  307  	return 0;
> > 33b347503f014eb Parav Pandit 2021-01-05  308 33b347503f014eb Parav
> > Pandit 2021-01-05  309  msg_err:
> > 33b347503f014eb Parav Pandit 2021-01-05  310  	genlmsg_cancel(msg,
> hdr);
> > 33b347503f014eb Parav Pandit 2021-01-05  311  	return err;
> > 33b347503f014eb Parav Pandit 2021-01-05  312  }
> 
> 
> Parav? Any patches for this one?

Thanks Dan for reporting.

There are no in kernel drivers today that can register vdpa device with device id > 31.
But I agree that this code should not assume that.
I will shortly supply a patch to fix this warning.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-25 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25  7:03 drivers/vdpa/vdpa.c:296 vdpa_mgmtdev_fill() warn: should '(((1))) << (mdev->id_table[i]->device)' be a 64 bit type? Dan Carpenter
2021-11-25 16:15 ` Michael S. Tsirkin
2021-11-25 16:52   ` Joe Perches
2021-11-25 17:33     ` Parav Pandit
2021-11-25 17:39   ` Parav Pandit

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).