2024-06-13 10:24:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v8 1/2] drivers: export to_ext_attr()

On Thu, Jun 13, 2024 at 11:28:29AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> Make to_ext_attr() available to code that wants to reuse struct
> dev_ext_attribute. While at it: make it into a static inline function.

Please don't use this, why is it needed?

thanks,

greg k-h


2024-06-13 12:34:39

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v8 1/2] drivers: export to_ext_attr()

On Thu, Jun 13, 2024 at 12:02 PM Greg Kroah-Hartman
<[email protected]> wrote:
>
> On Thu, Jun 13, 2024 at 11:28:29AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <[email protected]>
> >
> > Make to_ext_attr() available to code that wants to reuse struct
> > dev_ext_attribute. While at it: make it into a static inline function.
>
> Please don't use this, why is it needed?
>
> thanks,
>
> greg k-h

I had a struct in the gpio-virtuser module that consisted of a
device_attribute and a void pointer. Andy suggested reusing struct
dev_ext_attribute for that but I need this macro to access it when
only having the embedded struct device_attribute address.

Bart