[U-Boot] [PATCH-OMAP3] OMAP3: Plain numbers don't need parens

Graeme Russ graeme.russ at gmail.com
Tue Nov 4 22:42:58 CET 2008


On Wed, Nov 5, 2008 at 6:12 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Dirk,
>
> In message <49108377.0305560a.52c1.39ea at mx.google.com> you wrote:
>>
>> Use a consistent style. Plain numbers don't need parens. Proposed by Wolfgang Denk.
>>
>> Signed-off-by: Dirk Behme <dirk.behme at gmail.com>
> ...
>
> But...
>
>>  /* GPMC CS3/cs4/cs6 not avaliable */
>> -#define GPMC_BASE            (OMAP34XX_GPMC_BASE)
>> +#define GPMC_BASE            OMAP34XX_GPMC_BASE
>
> This is NOT a plain number. If I decide to use something like
>
> #define OMAP34XX_GPMC_BASE      FOO + BAR

Wouldn't we see that #define OMAP34XX_GPMC_BASE is not a plain number and
instead use:

#define OMAP34XX_GPMC_BASE      (FOO + BAR)

which makes

#define GPMC_BASE            OMAP34XX_GPMC_BASE

become

#define GPMC_BASE            (FOO + BAR)

Or am I misreading the issue?

>
> you might comment that such a #define is dangerous in itself, but why
> not protet against it? with a number we are sure we don't need parens,
> but with a macro we'd should rather play safe.
>
> 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
> Clothes make the man. Naked people have little  or  no  influence  on
> society.                                                 - Mark Twain
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list