[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXkdP/Rr+m30Hh72@smile.fi.intel.com>
Date: Wed, 27 Oct 2021 12:34:55 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Qian Cai <quic_qiancai@...cinc.com>
Cc: Yury Norov <yury.norov@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bitmap: simplify GENMASK(size - 1, 0) lines
On Tue, Oct 26, 2021 at 03:33:48PM -0400, Qian Cai wrote:
> On 10/26/21 3:21 PM, Andy Shevchenko wrote:
> > Can you explain to me how it is supposed to work?
> >
> > For example,
> >
> > x = 0xaa55;
> > size = 5;
> >
> > printf("%lu\n", find_first_bit(&x, size));
> >
> > In the resulting code we will always have 5 as the result,
> > but is it correct one?
>
> Sorry, my bad. GENMASK(size - 1, 0) would just become __GENMASK(size -
> 1, 0) instead of 0. Let me revisit it and run some tests first.
And we do not want to have __GENMASK() in the code.
Btw, I found one lurking around. Will fix it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists