Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/mdev: remove mtype_get_parent_dev

Just open code the dereferences in the only user.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/r/20220923092652.100656-10-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Christoph Hellwig and committed by
Alex Williamson
c7c1f38f 062e720c

+1 -14
+1 -2
drivers/s390/cio/vfio_ccw_ops.c
··· 62 62 struct mdev_type_attribute *attr, 63 63 char *buf) 64 64 { 65 - struct vfio_ccw_private *private = 66 - dev_get_drvdata(mtype_get_parent_dev(mtype)); 65 + struct vfio_ccw_private *private = dev_get_drvdata(mtype->parent->dev); 67 66 68 67 return sprintf(buf, "%d\n", atomic_read(&private->avail)); 69 68 }
-10
drivers/vfio/mdev/mdev_core.c
··· 23 23 static LIST_HEAD(mdev_list); 24 24 static DEFINE_MUTEX(mdev_list_lock); 25 25 26 - /* 27 - * Used in mdev_type_attribute sysfs functions to return the parent struct 28 - * device 29 - */ 30 - struct device *mtype_get_parent_dev(struct mdev_type *mtype) 31 - { 32 - return mtype->parent->dev; 33 - } 34 - EXPORT_SYMBOL(mtype_get_parent_dev); 35 - 36 26 /* Caller must hold parent unreg_sem read or write lock */ 37 27 static void mdev_device_remove_common(struct mdev_device *mdev) 38 28 {
-2
include/linux/mdev.h
··· 51 51 return container_of(dev, struct mdev_device, dev); 52 52 } 53 53 54 - struct device *mtype_get_parent_dev(struct mdev_type *mtype); 55 - 56 54 /* interface for exporting mdev supported type attributes */ 57 55 struct mdev_type_attribute { 58 56 struct attribute attr;