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.. Otherwise this looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>