Re: [PATCH v1 2/2] driver core: Make state_synced device attribute writeable

From: Doug Anderson
Date: Wed Mar 08 2023 - 12:35:36 EST


Hi,

On Fri, Mar 3, 2023 at 4:53 PM Saravana Kannan <saravanak@xxxxxxxxxx> wrote:
>
> > > --- a/drivers/base/base.h
> > > +++ b/drivers/base/base.h
> > > @@ -164,6 +164,14 @@ static inline int driver_match_device(struct device_driver *drv,
> > > return drv->bus->match ? drv->bus->match(dev, drv) : 1;
> > > }
> > >
> > > +static inline void dev_sync_state(struct device *dev)
> >
> > IMO don't force inline. The compiler is probably smarter than you. I
> > could even believe that it might be more optimal for this rarely
> > called function to be _not_ inline if it kept the kernel smaller. I
> > guess that means moving it out of the header...
>
> I'm following the style of every other function in the .h file.

Right, that's why I suggested moving it out of the .h file. I see
plenty of non-inline function definitions in the header file.

-Doug