lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] clk: divider: fix rate calculation for fractional rates
On 2014-01-28 12:32, Russell King - ARM Linux wrote:

>> Why I'm asking this is that for me (and probably for others also if
>> you've seen it used in the kernel code) it feels natural to have code like:
>>
>> rate = clk_round_rate(clk, rate);
>>
>> /* Verify the rounded rate here to see it's ok for the IP etc */
>>
>> /* The rate is ok, so set it */
>> clk_set_rate(clk, rate);
>
> If you want to do something with the rounded rate, then that's fine,
> you have a reason to do it this way. However, what I was referring to
> are drivers which literally do this:
>
> clk_set_rate(clk, clk_round_rate(clk, rate));

Thanks for clarification. Agreed, that's pointless. I gave the sequence
in the patch description just as an example for the sake of discussion
about the bug.

I didn't realize people actually do that in real code =).

Tomi


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-01-28 12:21    [W:0.067 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site