[U-Boot-Users] [PATCH] fix compilation problem for mpc8349itx CFG_RAMBOOT
Wolfgang Denk
wd at denx.de
Wed May 23 20:38:53 CEST 2007
In message <46547E55.3020608 at freescale.com> you wrote:
>
> How about this approach instead:
>
> #ifdef CFG_NO_FLASH
> #define CONFIG_COMMANDS_FLASH ~(CFG_CMD_FLASH | CFG_CMD_IMLS)
> #else
> #define CONFIG_COMMANDS_FLASH ~0
> #endif
>
> #define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
> CONFIG_COMMANDS_CF | \
> CFG_CMD_NET | \
> CFG_CMD_PING | \
> CONFIG_COMMANDS_I2C | \
> CONFIG_COMMANDS_PCI | \
> CFG_CMD_SDRAM | \
> CFG_CMD_DATE | \
> CFG_CMD_CACHE | \
> CFG_CMD_IRQ) & \
> CONFIG_COMMANDS_FLASH
This is extremely inconsistent. Some CONFIG_COMMANDS_* (PCI, I2C) are
used to add features, while others (FLASH) are used to remove
features. I consinder this very error prone.
Also, you might consider using better (i. e. local) preprocessor
variable names for such functions. Note that CONFIG_* and
CONFIG_COMMANDS* is kind of reserved by U-Boot, in the sense that it
has a pre-defined meaning. You should avoid using such names for
local variables; you might run into unpleasant faiulures sooner or
later. In general, it is always a good idea to avoid name space
pollution.
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
When some people discover the truth, they just can't understand why
everybody isn't eager to hear it.
More information about the U-Boot
mailing list