[U-Boot] [PATCH v2 1/2] linux/bitops.h: Add BIT macro

Simon Glass sjg at chromium.org
Wed Apr 29 17:04:12 CEST 2015


Hi Bin,

On 29 April 2015 at 08:59, Bin Meng <bmeng.cn at gmail.com> wrote:
>
> Hi Simon,
>
> On Wed, Apr 29, 2015 at 10:42 PM, Simon Glass <sjg at chromium.org> wrote:
> > Hi Tom,
> >
> > On 29 April 2015 at 07:08, Tom Rini <trini at konsulko.com> wrote:
> >> On Wed, Apr 29, 2015 at 05:35:05PM +0530, Jagannadha Sutradharudu Teki wrote:
> >>
> >>> Replace (1 << nr) to BIT(nr) where nr = 0, 1, 2 .... 31
> >>>
> >>> Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>
> >>> Cc: Masahiro Yamada <yamada.m at jp.panasonic.com>
> >>> Cc: Tom Rini <trini at konsulko.com>
> >>> Cc: Simon Glass <sjg at chromium.org>
> >>
> >> I think that conceptually this is a good idea.  We need to apply this
> >> fairly quickly however as it already throws out a few rejects with the
> >> PRs I've taken and doing some local testing on.
> >
> > We have to date avoided this (I've been here before). But I think it
> > is useful. One concern I have is misuse, when someone does BIT(0) |
> > BIT(1))| BIT(2) | BIT(3) instead of 0xf, for example.
>
> Yep, the Intel Quark MRC stuff :)

A few years ago - one of my first patch series to U-Boot had bitfield
macros and it did not receive a warm reception :-)

>
> > Anyway as you say, let's do it fast if we are going this way.
> >
>
> Do we have to rework the Quark MRC to use the BIT(nr) again? I guess no?

I don't think so.

Regards,
Simon


More information about the U-Boot mailing list