* [RFC PATCH] clock: correct the comparison parameter of MHz
@ 2013-08-07 7:47 Bo Shen
2013-08-07 8:02 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Bo Shen @ 2013-08-07 7:47 UTC (permalink / raw)
To: linux-arm-kernel
correct the comparison parameter of MHz from 4,000,000 to 1,000,000
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
kernel/time/sched_clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index a326f27..62885f7 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -128,7 +128,7 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);
r = rate;
- if (r >= 4000000) {
+ if (r >= 1000000) {
r /= 1000000;
r_unit = 'M';
} else if (r >= 1000) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC PATCH] clock: correct the comparison parameter of MHz
2013-08-07 7:47 [RFC PATCH] clock: correct the comparison parameter of MHz Bo Shen
@ 2013-08-07 8:02 ` Russell King - ARM Linux
2013-08-07 8:08 ` Bo Shen
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2013-08-07 8:02 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 07, 2013 at 03:47:40PM +0800, Bo Shen wrote:
> correct the comparison parameter of MHz from 4,000,000 to 1,000,000
You're assuming this wasn't intentional. As the division by 1000000
ends up losing the fractional rate, I decided to leave 1-4MHz as kHz,
so something like 1.832MHz would be displayed as 1832kHz and not
1MHz.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH] clock: correct the comparison parameter of MHz
2013-08-07 8:02 ` Russell King - ARM Linux
@ 2013-08-07 8:08 ` Bo Shen
0 siblings, 0 replies; 3+ messages in thread
From: Bo Shen @ 2013-08-07 8:08 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russell King,
On 8/7/2013 16:02, Russell King - ARM Linux wrote:
> On Wed, Aug 07, 2013 at 03:47:40PM +0800, Bo Shen wrote:
>> correct the comparison parameter of MHz from 4,000,000 to 1,000,000
>
> You're assuming this wasn't intentional. As the division by 1000000
> ends up losing the fractional rate, I decided to leave 1-4MHz as kHz,
> so something like 1.832MHz would be displayed as 1832kHz and not
> 1MHz.
Thanks for clarification of this. Now, it is better for me to understand
this piece of code.
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-07 8:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-07 7:47 [RFC PATCH] clock: correct the comparison parameter of MHz Bo Shen
2013-08-07 8:02 ` Russell King - ARM Linux
2013-08-07 8:08 ` Bo Shen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).