lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 01 May 2008 12:48:25 -0700
From:	Daniel Walker <dwalker@...sta.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	johnstul@...ibm.com, ralf@...ux-mips.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clocksource: shift helper


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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ