Re: [PATCHv8 RFC] pwm: Add Freescale FTM PWM driver support

From: Dmitry Torokhov
Date: Fri Jan 03 2014 - 18:40:02 EST


On Fri, Jan 03, 2014 at 09:16:06AM +0000, Li.Xiubo@xxxxxxxxxxxxx wrote:
> Hi Dmitry,
>
> > Subject: Re: [PATCHv8 RFC] pwm: Add Freescale FTM PWM driver support
> >
> > Hi Xiubo,
> >
> > On Fri, Jan 03, 2014 at 01:24:21PM +0800, Xiubo Li wrote:
> > > +
> > > +static inline int fsl_pwm_calculate_default_ps(struct fsl_pwm_chip *fpc,
> > > + enum fsl_pwm_clk index)
> > > +{
> >
> > Why do you declare this (and other module-local) function as inline?
> > It is usually better let compiler decide if given function should be
> > inlined or not.
> >
>
> Could the compiler know when the given function should be inlined by
> not declare it?

Yes.

> And when will be inlined ?

When it makes sense to do so from compiler's point of view: i.e. it is
smallish or with single call site and there are enough registers, etc,
etc.

Thanks.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/