lkml.org 
[lkml]   [2018]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clocksource: mips-gic-timer: fix clocksource counter width
From
Date
On 2018-02-28 09:56, Thomas Gleixner wrote:
> On Wed, 21 Feb 2018, Felix Fietkau wrote:
>
>> This code needs to use ffs instead of fls on the mask to determine the
>> shift for reading the GIC_CONFIG_COUNTBITS field.
>
> Why?
>> count_width = read_gic_config() & GIC_CONFIG_COUNTBITS;
>> - count_width >>= __fls(GIC_CONFIG_COUNTBITS);
>> + count_width >>= __ffs(GIC_CONFIG_COUNTBITS);
This code is trying to extract the GIC_CONFIG_COUNTBITS field from
read_gic_config(), so it needs to shift count_width right by the index
of the least significant bit (__ffs) instead of the most significant bit
(__fls) of the field mask.

- Felix

\
 
 \ /
  Last update: 2018-02-28 10:20    [W:0.121 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site