public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Michal Schmidt <mschmidt@redhat.com>
Cc: Alex Elder <elder@linaro.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] bitfield.h: add FIELD_MAX_CONST
Date: Tue, 21 May 2024 12:52:47 -0700	[thread overview]
Message-ID: <Zkz7jyR1HJCIPqku@yury-ThinkPad> (raw)
In-Reply-To: <CADEbmW0BZbJQbaycqq+vfisEJyGd57uzEgFEckusGLJSLvmYDA@mail.gmail.com>

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@linaro.org> wrote:
> > On 5/20/24 2:29 PM, Yury Norov wrote:
> > > + Alex Elder <elder@linaro.org>, Jakub Kicinski <kuba@kernel.org> and
> > > David S. Miller <davem@davemloft.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

      reply	other threads:[~2024-05-21 19:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 17:27 [PATCH] bitfield.h: add FIELD_MAX_CONST Michal Schmidt
2024-05-20 19:29 ` Yury Norov
2024-05-20 22:26   ` Jakub Kicinski
2024-05-21 12:33   ` Alex Elder
2024-05-21 14:44     ` Michal Schmidt
2024-05-21 19:52       ` Yury Norov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zkz7jyR1HJCIPqku@yury-ThinkPad \
    --to=yury.norov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=elder@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mschmidt@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox