[PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support
Segher Boessenkool
segher at kernel.crashing.org
Tue Apr 22 02:28:10 EST 2008
>>> +static inline void gtm_ack_timer16(struct gtm_timer *tmr, u16
>>> events)
>>> +{
>>> + out_be16(tmr->gtevr, events);
>>> +}
>>
>> Drop 'inline' and expect gcc to do the right thing.
>
> Not sure about newer gccs, but older complained about "defined but not
> used" functions w/o inline keyword. I'm almost sure that this is still
> true.
It is. So why is it unused? Because you put the code in the header
file. Can't you move it to the .c file instead?
> I can surely use __maybe_unused, but "static inline" is pretty
> settled tradition, plus this function is small enough anyway.
All code in header files should be inline. Code in implementation
files should only be inline if you have a very good reason for
doing so. Same goes for __maybe_unused.
Segher
More information about the Linuxppc-dev
mailing list