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

Anton Staaf robotboy at google.com
Thu Jul 14 19:29:04 CEST 2011


On Thu, Jul 14, 2011 at 9:00 AM, Albert ARIBAUD
<albert.u.boot at aribaud.net> wrote:
> Hi Anton,
>
> Le 13/07/2011 18:47, Anton Staaf a écrit :
>
>> I agree in general that it is preferable to be as explicit as
>> possible.  But it is also good to be able to express your intent,
>> instead of implementation when possible.  In other words, I would
>> rather be explicit about my intent, than the particular
>> implementation.
>
> Seems to me that for you, showing intent and implementation are necessarily
> exclusive; however, Wolfgang's examples indeed show implementation, but they
> show intent as well, at least for me they do.

I'm not sure which example you mean.  If you mean his #define of the
masks explicitly, those are fine by me.  My above statement is about
the masking, oring and shifting that is done in the same way every
time and could be encoded in a macro that makes it easier to see what
exactly is going on.  Or did I misunderstand which example you mean?

Thanks,
    Anton

> Amicalement,
> --
> Albert.
>


More information about the U-Boot mailing list