lkml.org 
[lkml]   [2016]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subject[problem on 32-bit systems] changing the type of clk_rate to "long long"?
Hi.


When I was testing my clk driver + generic cpufreq driver,
I was hit by a problem.


Everything worked fine on my 64-bit SoCs,
but not on 32-bit SoCs.


I found the cause of the problem was
that the type of clk_rate is "long".

It is long enough on 64-bit systems,
but only 32-bit wide on 32-bit systems.


The CPU clocks on my SoCs
are derived from a 2.4GHz PLL.


The .round_rate() callback tries to return 2400000000,
but it does not fit in a signed 32-bit-wide variable
and it is treated as -1894967296, which is an error.


In order to handle clock frequency safely,
shall we use "long long" instead?
(It is guaranteed to have 64-bit width)



--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2016-10-15 04:56    [W:0.039 / U:2.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site