Re: [PATCH 11/18] vfio/mdev: Add mdev/mtype_get_type_group_id()

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

 



On Tue, Mar 23, 2021 at 08:23:30PM +0100, Christoph Hellwig wrote:
> On Tue, Mar 23, 2021 at 02:55:28PM -0300, Jason Gunthorpe wrote:
> > +/*
> > + * Return the index in supported_type_groups that this mdev_device was created
> > + * from.
> > + */
> > +unsigned int mdev_get_type_group_id(struct mdev_device *mdev)
> > +{
> > +	return mdev->type->type_group_id;
> > +}
> > +EXPORT_SYMBOL(mdev_get_type_group_id);
> > +
> > +/*
> > + * Used in mdev_type_attribute sysfs functions to return the index in the
> > + * supported_type_groups that the sysfs is called from.
> > + */
> > +unsigned int mtype_get_type_group_id(struct kobject *mtype_kobj)
> > +{
> > +	return container_of(mtype_kobj, struct mdev_type, kobj)->type_group_id;
> > +}
> > +EXPORT_SYMBOL(mtype_get_type_group_id);
> 
> The single field accessors are a little silly..

Looked at this for a while, and to fix it I'd have to pull in the
struct mdev_parent into the public header too (for
mtype_get_parent_dev()) and I think the two silly accessors are the
lessor evil at that point.

Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux