From: suratiamol at gmail.com (Amol Surati)
Subject: [Linux-kernel-mentees] [PATCH] cs5535: use BIT() macro for defining bit-flags
Date: Mon, 8 Jul 2019 14:27:35 +0530 [thread overview]
Message-ID: <20190708085735.GA12241@arch> (raw)
In-Reply-To: <CAHp75VfceRDnuRtdD_mR6mMZF_LH7u1ptPRXiA=DUfgTGebCPA@mail.gmail.com>
On Mon, Jul 08, 2019 at 11:02:29AM +0300, Andy Shevchenko wrote:
> On Sun, Jul 7, 2019 at 2:30 PM Amol Surati <suratiamol at gmail.com> wrote:
> >
> > The BIT() macro is available for defining the required bit-flags.
>
> Shouldn't bits.h be added?
>
> > Since it operates on an unsigned value and expands to an unsigned result,
> > using it, instead of an expression like (1 << x), also fixes the problem
> > of shifting a signed 32-bit value by 31 bits. (e.g. 1 << 31. See
> > CS5536_GPIOM7_PME_FLAG and CS5536_GPIOM7_PME_EN).
>
> What problem?
> You need to describe that (UB by the standard, though gcc works fine,
> I never heard it utilizes such).
Yes. I will send a new version. I also missed including
<linux/bitops.h>, although the compilation with the default
configuration of my distro still succeeds without it, by chance.
Thank you,
-amol
>
> --
> With Best Regards,
> Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: suratiamol@gmail.com (Amol Surati)
Subject: [Linux-kernel-mentees] [PATCH] cs5535: use BIT() macro for defining bit-flags
Date: Mon, 8 Jul 2019 14:27:35 +0530 [thread overview]
Message-ID: <20190708085735.GA12241@arch> (raw)
Message-ID: <20190708085735.nj9pQi1VVBbPM9_Daf7vSIIIUNei5ebF6R0vjvWkiN4@z> (raw)
In-Reply-To: <CAHp75VfceRDnuRtdD_mR6mMZF_LH7u1ptPRXiA=DUfgTGebCPA@mail.gmail.com>
On Mon, Jul 08, 2019 at 11:02:29AM +0300, Andy Shevchenko wrote:
> On Sun, Jul 7, 2019 at 2:30 PM Amol Surati <suratiamol at gmail.com> wrote:
> >
> > The BIT() macro is available for defining the required bit-flags.
>
> Shouldn't bits.h be added?
>
> > Since it operates on an unsigned value and expands to an unsigned result,
> > using it, instead of an expression like (1 << x), also fixes the problem
> > of shifting a signed 32-bit value by 31 bits. (e.g. 1 << 31. See
> > CS5536_GPIOM7_PME_FLAG and CS5536_GPIOM7_PME_EN).
>
> What problem?
> You need to describe that (UB by the standard, though gcc works fine,
> I never heard it utilizes such).
Yes. I will send a new version. I also missed including
<linux/bitops.h>, although the compilation with the default
configuration of my distro still succeeds without it, by chance.
Thank you,
-amol
>
> --
> With Best Regards,
> Andy Shevchenko
next prev parent reply other threads:[~2019-07-08 8:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-07 11:30 [Linux-kernel-mentees] [PATCH] cs5535: use BIT() macro for defining bit-flags suratiamol
2019-07-07 11:30 ` Amol Surati
2019-07-08 8:02 ` andy.shevchenko
2019-07-08 8:02 ` Andy Shevchenko
2019-07-08 8:57 ` suratiamol [this message]
2019-07-08 8:57 ` Amol Surati
2019-07-08 15:02 ` andy.shevchenko
2019-07-08 15:02 ` Andy Shevchenko
2019-07-10 8:39 ` [Linux-kernel-mentees] [PATCH v2] " suratiamol
2019-07-10 8:39 ` Amol Surati
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=20190708085735.GA12241@arch \
--to=unknown@example.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.