]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2022 13:16:07 +0000 (15:16 +0200)
commitdb574d3bb6e5a26a55e174ff45ca84ddc7928eb4
tree16ff6e59bacb26695b4bdb4339e103bb085e8b5f
parenta2fbf4acd28069d4922c33e4b5b0d58fc38073f8
vfio/mdev: Make to_mdev_device() into a static inline

[ Upstream commit 66873b5fa738ca02b5c075ca4a410b13d88e6e9a ]

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: 99e3123e3d72 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/mdev/mdev_private.h