[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zkz7jyR1HJCIPqku@yury-ThinkPad>
Date: Tue, 21 May 2024 12:52:47 -0700
From: Yury Norov <yury.norov@...il.com>
To: Michal Schmidt <mschmidt@...hat.com>
Cc: Alex Elder <elder@...aro.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] bitfield.h: add FIELD_MAX_CONST
On Tue, May 21, 2024 at 04:44:33PM +0200, Michal Schmidt wrote:
> On Tue, May 21, 2024 at 2:33 PM Alex Elder <elder@...aro.org> wrote:
> > On 5/20/24 2:29 PM, Yury Norov wrote:
> > > + Alex Elder <elder@...aro.org>, Jakub Kicinski <kuba@...nel.org> and
> > > David S. Miller <davem@...emloft.net>
> >
> > Thanks for adding me to this.
> >
> > My bottom line response is that I don't understand exactly
> > what problem this is solving (but I trust it solves a
> > problem for you). It *seems* like the existing macro(s)
> > should work for you, and if they don't, you might not be
> > using it (them) correctly. And... if a fix is needed, it
> > should be made to the existing macro if possible.
>
> Yury, Jakub, Alex,
> thanks for your reviews so far.
>
> All of you want to avoid adding another macro. I agree and I will be back
> with v2.
>
> To clarify where exactly I ran into the current limitations of FIELD_MAX:
> I am reworking drivers/net/ethernet/intel/ice/ice_gnss.c:ice_gnss_read().
> There, I will be changing "buf" to a small on-stack array:
> char buf[ICE_MAX_I2C_DATA_SIZE];
> where ICE_MAX_I2C_DATA_SIZE is defined using FIELD_MAX.
>
> There are a few more issues. I extracted them into this test case that
> I would like to make compilable:
Whatever you make with this, please add a 2nd patch with a test(s)
covering your cases. You can refer the test_bitmap_const_eval() in
lib/test_bitmap.c for an examples of how the compile-time expressions
are tested. The best place for the test would be lib/test_bitops, I
think.
Thanks,
Yury
Powered by blists - more mailing lists