Re: [PATCH] staging: greybus: mark PM functions as __maybe_unused

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

 



On Fri, May 19, 2017 at 5:40 AM, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> On 18-05-17, 16:51, Arnd Bergmann wrote:
>> I find that a lot of users get the #ifdef wrong, either using the wrong
>> macro (CONFIG_PM vs CONFIG_PM_SLEEP) or not using the right
>> set of functions (e.g. calling a function only from the suspend handler).
>>
>> The __maybe_unused annotation avoids both problems and also gives
>> better build time coverage, so that's what I tend to use.
>
> Thanks for the explanation Arnd. I hope these unused routines will not
> be part of the binary that gets generated. Right?

Correct. Ancient compilers (gcc-4.1) had a bug where a function would
still be part of the binary if the only reference to it was from a function
pointer that got dropped through dead code elimination, but that is not
the case here, and those old compilers are not used in real life any more
either.

       Arnd
_______________________________________________
greybus-dev mailing list
greybus-dev@xxxxxxxxxxxxxxxx
https://lists.linaro.org/mailman/listinfo/greybus-dev




[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux