Re: [PATCH v2 01/51] iio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2 Jan 2022 09:15:06 -0500
Arnd Bergmann <arnd@xxxxxxxx> wrote:

> On Sun, Jan 2, 2022 at 7:55 AM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> >
> > -static SIMPLE_DEV_PM_OPS(da311_pm_ops, da311_suspend, da311_resume);
> > +DEFINE_SIMPLE_DEV_PM_OPS(da311_pm_ops, da311_suspend, da311_resume);
> >  

Hi Arnd,

> 
> Does the new DEFINE_SIMPLE_DEV_PM_OPS imply 'static'? 

It does.

> I see that you remove
> the specifier in all the patches, which would not work otherwise, but
> I wonder what that
> means for drivers that actually define the pm-ops globally on purpose
> and can't do
> that any more after the conversion.

That came up in discussion of the patch series introducing this macro
https://lore.kernel.org/linux-pm/20211216110936.6ccd07d3@jic23-huawei/

Most of the cases that don't define it as static
also export the symbol for use by other modules so the approach of letting
the compiler detect it as dead code won't always work.

Exceptions from a bit of grepping are
net/ethernet/broadcom/bnx2x/
scsi/esas2r/esas2r_init.c
  not sure on reasoning behind the file splits in these drivers
  but definitely looks like it we could just merge a few files
  and let this be static + the compiler remove it neatly.

vs 17 cases where the symbol is exported and more cleverness will
be needed.

Jonathan

> 
>       Arnd




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux