提交 5fdade95 编写于 作者: N Nicolas Pitre 提交者: Thomas Gleixner

time: Rename misnamed minsec argument of clocks_calc_mult_shift()

The minsec argument to clocks_calc_mult_shift() is misnamed. It is used 
to clamp the magnitude of the mult factor so that a multiplication with 
any value in the given range won't overflow a 64 bit result.  Let's 
rename it to match the actual usage.
Signed-off-by: NNicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: NJohn Stultz <johnstul@us.ibm.com>
LKML-Reference: <alpine.LFD.2.00.1101111207140.17086@xanadu.home>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 cb600d2f
...@@ -113,7 +113,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); ...@@ -113,7 +113,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time);
* @shift: pointer to shift variable * @shift: pointer to shift variable
* @from: frequency to convert from * @from: frequency to convert from
* @to: frequency to convert to * @to: frequency to convert to
* @minsec: guaranteed runtime conversion range in seconds * @maxsec: guaranteed runtime conversion range in seconds
* *
* The function evaluates the shift/mult pair for the scaled math * The function evaluates the shift/mult pair for the scaled math
* operations of clocksources and clockevents. * operations of clocksources and clockevents.
...@@ -122,7 +122,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); ...@@ -122,7 +122,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time);
* NSEC_PER_SEC == 1GHz and @from is the counter frequency. For clock * NSEC_PER_SEC == 1GHz and @from is the counter frequency. For clock
* event @to is the counter frequency and @from is NSEC_PER_SEC. * event @to is the counter frequency and @from is NSEC_PER_SEC.
* *
* The @minsec conversion range argument controls the time frame in * The @maxsec conversion range argument controls the time frame in
* seconds which must be covered by the runtime conversion with the * seconds which must be covered by the runtime conversion with the
* calculated mult and shift factors. This guarantees that no 64bit * calculated mult and shift factors. This guarantees that no 64bit
* overflow happens when the input value of the conversion is * overflow happens when the input value of the conversion is
...@@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time); ...@@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(timecounter_cyc2time);
* factors. * factors.
*/ */
void void
clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec) clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 maxsec)
{ {
u64 tmp; u64 tmp;
u32 sft, sftacc= 32; u32 sft, sftacc= 32;
...@@ -140,7 +140,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec) ...@@ -140,7 +140,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec)
* Calculate the shift factor which is limiting the conversion * Calculate the shift factor which is limiting the conversion
* range: * range:
*/ */
tmp = ((u64)minsec * from) >> 32; tmp = ((u64)maxsec * from) >> 32;
while (tmp) { while (tmp) {
tmp >>=1; tmp >>=1;
sftacc--; sftacc--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册