From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75352C433DB for ; Tue, 23 Mar 2021 19:24:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A819619CC for ; Tue, 23 Mar 2021 19:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbhCWTYD (ORCPT ); Tue, 23 Mar 2021 15:24:03 -0400 Received: from verein.lst.de ([213.95.11.211]:33947 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231449AbhCWTXc (ORCPT ); Tue, 23 Mar 2021 15:23:32 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 45E3268BEB; Tue, 23 Mar 2021 20:23:31 +0100 (CET) Date: Tue, 23 Mar 2021 20:23:30 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Alex Williamson , Cornelia Huck , kvm@vger.kernel.org, Kirti Wankhede , "Raj, Ashok" , Dan Williams , Christoph Hellwig , Leon Romanovsky , Max Gurtovoy , Tarun Gupta Subject: Re: [PATCH 11/18] vfio/mdev: Add mdev/mtype_get_type_group_id() Message-ID: <20210323192330.GI17735@lst.de> References: <0-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> <11-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11-v1-7dedf20b2b75+4f785-vfio2_jgg@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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