]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/mdev: Make to_mdev_device() into a static inline
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 30 Mar 2021 15:53:07 +0000 (09:53 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Apr 2021 17:55:11 +0000 (11:55 -0600)
commita8ab81bcb542a4d71d41f6a47fe867d78a902192
tree9e0a9612e347dee157ea2e678fc288c86b9eda76
parent082c2215cd079c782a329b0703beaca000a6c3d9
vfio/mdev: Make to_mdev_device() into a static inline

The macro wrongly uses 'dev' as both the macro argument and the member
name, which means it fails compilation if any caller uses a word other
than 'dev' as the single argument. Fix this defect by making it into
proper static inline, which is more clear and typesafe anyhow.

Fixes: de3b28e73c2e ("vfio-mdev: Make mdev_device private and abstract interfaces")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <11-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/mdev/mdev_private.h