lkml.org 
[lkml]   [2008]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clocksource: shift helper
From
Date

On Thu, 2008-05-01 at 12:32 -0700, Andrew Morton wrote:

> > +static inline u32 clocksource_hz2shift(u32 bits, u32 hz)
> > +{
> > + u64 temp;
> > +
> > + for (; bits > 0; bits--) {
> > + temp = (u64) NSEC_PER_SEC << bits;
> > + do_div(temp, hz);
> > + if ((temp >> 32) == 0)
> > + break;
> > + }
> > + return bits;
> > +}
>
> If we expect this to have more than one callsite then it would be best to
> uninline it.
>
> Unless we always expect it to be called from __init code, in which case
> it's best to inline it ;)

I expect it would always get called from __init flagged functions. The
clocksource can't get registed/used with out the shift and mult values.

If we did uninline this one, we would have to do the other helpers too.
I imagine the use case is the same for all of them ..

Daniel



\
 
 \ /
  Last update: 2008-05-01 21:51    [W:0.055 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site