From: Johannes Berg <johannes@sipsolutions.net>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH v2] bitfield: fix *_encode_bits()
Date: Fri, 15 Jun 2018 11:30:23 +0200 [thread overview]
Message-ID: <1529055023.10037.0.camel@sipsolutions.net> (raw)
In-Reply-To: <CAHp75Vf372rACqseUNYEba3Gw1Hg+PmdFdn+a2ex=2JzWZ2nWQ@mail.gmail.com> (sfid-20180615_105120_207050_DFE22571)
On Fri, 2018-06-15 at 11:51 +0300, Andy Shevchenko wrote:
> On Fri, Jun 15, 2018 at 12:26 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > There's a bug in *_encode_bits() in using ~field_multiplier() for
> > the check whether or not the constant value fits into the field,
> > this is wrong and clearly ~field_mask() was intended. This was
> > triggering for me for both constant and non-constant values.
> >
> > Additionally, make this case actually into an compile error.
> > Declaring the extern function that will never exist with just a
> > warning is pointless as then later we'll just get a link error.
> >
> > While at it, also fix the indentation in those lines I'm touching.
>
> I'm just wondering if we have test cases for that API.
> If not, perhaps it's a good time to start (perhaps extend test_bitmap.c)?
I guess. Do we have infrastructure to provoke & check compile errors
though?
johannes
next prev parent reply other threads:[~2018-06-15 9:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-14 21:26 [PATCH v2] bitfield: fix *_encode_bits() Johannes Berg
2018-06-15 8:51 ` Andy Shevchenko
2018-06-15 9:30 ` Johannes Berg [this message]
2018-06-15 13:02 ` Andy Shevchenko
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=1529055023.10037.0.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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