[U-Boot] [PATCH 5/7] sunxi-common.h: Use new generic $bootcmd

Stephen Warren swarren at wwwdotorg.org
Fri Aug 1 20:54:59 CEST 2014


On 08/01/2014 01:46 AM, Hans de Goede wrote:
> Use the new standard bootcmd from <config_distro_bootcmd.h>.

Acked-by: Stephen Warren <swarren at nvidia.com>

> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h

> +#ifdef CONFIG_AHCI
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(MMC, mmc, 0) \
> +	func(SCSI, scsi, 0) \
> +	func(USB, usb, 0) \
> +	func(PXE, pxe, na) \
> +	func(DHCP, dhcp, na)
> +#else
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(MMC, mmc, 0) \
> +	func(USB, usb, 0) \
> +	func(PXE, pxe, na) \
> +	func(DHCP, dhcp, na)
> +#endif

In the spirit of using crazy macros (!) :-) I might code that as:

#ifdef CONFIG_AHCI
#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
#else
#define BOOT_TARGET_DEVICES_SCSI(func)
#endif

#define BOOT_TARGET_DEVICES(func) \
	func(MMC, mmc, 0) \
	BOOT_TARGET_DEVICES_SCSI(func) \
	func(USB, usb, 0) \
	func(PXE, pxe, na) \
	func(DHCP, dhcp, na)

... since it doesn't duplicate the rest of the main macro, but either 
way is fine by me.



More information about the U-Boot mailing list