[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aEmTAMc9stMWMMI-@yury>
Date: Wed, 11 Jun 2025 10:30:24 -0400
From: Yury Norov <yury.norov@...il.com>
To: I Hsin Cheng <richard120310@...il.com>
Cc: jstultz@...gle.com, tglx@...utronix.de, sboyd@...nel.org,
linux-kernel@...r.kernel.org, yurynorov@...il.com,
skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev,
jserv@...s.ncku.edu.tw
Subject: Re: [PATCH v3] clocksource: Replace loop within
clocks_calc_mult_shift() with find_last_bit() for calculation of "sftacc"
On Wed, Jun 11, 2025 at 10:26:39PM +0800, I Hsin Cheng wrote:
> line
> In-Reply-To: <aEltbEpA7US9h8qN@...y>
> Status: O
> Content-Length: 5191
> Lines: 144
>
> On Wed, Jun 11, 2025 at 07:50:04AM -0400, Yury Norov wrote:
> > On Wed, Jun 11, 2025 at 03:36:08PM +0800, I Hsin Cheng wrote:
> Hi Yury,
>
> Thanks for your suggestions !
>
> > 1. sftacc is known to be 32. Comparing against 0 is useless.
> > 2. Just use __fls():
> > if (tmp)
> > sftacc -=__fls(tmp) + 1;
> >
>
> No problem, I'll fix them up in the next version.
> Just wondering the reason to use __fls() directly, is it because we're
> sure that the value of "tmp" will definitely fall into
> small_const_nbits() case in find_last_bit() ?
That's because tmp is not a bitmap. It's u64.
Powered by blists - more mailing lists