[U-Boot] [RESEND PATCH v2 1/5] Tegra2: Add macros to calculate bitfield shifts and masks

Wolfgang Denk wd at denx.de
Mon Jul 11 08:16:33 CEST 2011


Dear Simon Glass,

In message <CAPnjgZ1Oymaa2_gQGxw88jJG2Kr_fN6tJ5HDgUiOHPjw7jX2=g at mail.gmail.com> you wrote:
>
> > Not sure I follow you: the added lines below do indeed add bitfield access
> > macros, don't they?
> >
> > No these are just for defining the shifts and masks. There is no access

But you write yourself in the comment: "...easily getting mask and
shift values for bit fields".

> The only benefit is to avoid having to calculate all of these masks and
> shifts in your head. It is basically just a shortcut and assists with
> checking code against datasheets. Of course I would prefer to have access
> through macros also but that was shot down so the code is now full of manual
> shifts and ANDs. I hope that at least this small convenience will be
> acceptable.

Sorry, but because such code is unportable we do not accept it, as it
would lead to driver code that becomes unportable, too.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the pitiful, multipage, connection-boxed form to which  the  flow-
chart  has  today  been  elaborated, it has proved to be useless as a
design tool -- programmers draw flowcharts after, not before, writing
the programs they describe.                        - Fred Brooks, Jr.


More information about the U-Boot mailing list