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 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>



[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