[PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm
Nicolin Chen
nicolinc at nvidia.com
Thu Oct 17 09:12:03 PDT 2024
On Thu, Oct 17, 2024 at 12:37:49PM -0300, Jason Gunthorpe wrote:
> On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote:
> > On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote:
> >
> > > @@ -217,12 +217,12 @@ iommufd_object_put_and_try_destroy(struct iommufd_ctx *ictx,
> > > iommufd_object_remove(ictx, obj, obj->id, 0);
> > > }
> > >
> > > -struct iommufd_object *_iommufd_object_alloc(struct iommufd_ctx *ictx,
> > > - size_t size,
> > > - enum iommufd_object_type type);
> > > +struct iommufd_object *iommufd_object_alloc_elm(struct iommufd_ctx *ictx,
> > > + size_t size,
> > > + enum iommufd_object_type type);
> >
> > Maybe call it raw instead of elm? elm suggests it is an item in an
> > array or likewise
>
> Or keep this as the __ and rename
You mean "_" v.s. "__"?
> #define __iommufd_object_alloc(ictx, ptr, type, obj) \
>
> That one to _elm like this:
>
> #define iommufd_object_alloc_elm(ictx, ptr, type, elm) \
> container_of(_iommufd_object_alloc( \
> ictx, \
> sizeof(*(ptr)) + BUILD_BUG_ON_ZERO( \
> offsetof(typeof(*(ptr)), \
> obj) != 0), \
> type), \
> typeof(*(ptr)), elm)
>
> #define iommufd_object_alloc(ictx, ptr, type) \
> iommufd_object_alloc_elm(ictx, ptr, type, obj)
>
> Then you can keep the pattern of _ being the allocation function of
> the macro
If I get it correctly, the change would be
[From]
level-0: iommufd_object_alloc()
level-1: __iommufd_object_alloc()
level-2: _iommufd_object_alloc()
[To]
level-0: iommufd_object_alloc()
level-1: iommufd_object_alloc_elm()
level-2: _iommufd_object_alloc()
i.e. change the level-1 only.
Thanks
Nicolin
More information about the linux-arm-kernel
mailing list