From 4a8c3f693ef2b50b5db5a95a2c32531b35d31dc0 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Fri, 24 Oct 2014 20:13:51 +0200 Subject: [PATCH] Use __stringify() instead of xstr() Some boards still use xstr(). Replace remaining occurrences of xstr() by commonly used __stringify(). Signed-off-by: Anatolij Gustschin --- include/configs/mcx.h | 9 +++------ include/configs/o2d.h | 6 +++--- include/configs/o2d300.h | 6 +++--- include/configs/o2dnt-common.h | 7 ++----- include/configs/o2dnt2.h | 6 +++--- include/configs/o2i.h | 6 +++--- include/configs/o2mnt.h | 6 +++--- include/configs/o3dnt.h | 6 +++--- include/configs/woodburn_common.h | 12 +++++------- include/configs/x600.h | 27 +++++++++++++-------------- 10 files changed, 41 insertions(+), 50 deletions(-) diff --git a/include/configs/mcx.h b/include/configs/mcx.h index adaf44f68f..b775ebd0ed 100644 --- a/include/configs/mcx.h +++ b/include/configs/mcx.h @@ -172,9 +172,6 @@ #define CONFIG_BOOTFILE "uImage" -#define xstr(s) str(s) -#define str(s) #s - /* Setup MTD for NAND on the SOM */ #define MTDIDS_DEFAULT "nand0=omap2-nand.0" #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(MLO)," \ @@ -201,13 +198,13 @@ "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ "baudrate=115200\0" \ "consoledev=ttyO2\0" \ - "hostname=" xstr(CONFIG_HOSTNAME) "\0" \ + "hostname=" __stringify(CONFIG_HOSTNAME) "\0" \ "loadaddr=0x82000000\0" \ "load=tftp ${loadaddr} ${u-boot}\0" \ "load_k=tftp ${loadaddr} ${bootfile}\0" \ "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \ "loadmlo=tftp ${loadaddr} ${mlo}\0" \ - "mlo=" xstr(CONFIG_HOSTNAME) "/MLO\0" \ + "mlo=" __stringify(CONFIG_HOSTNAME) "/MLO\0" \ "mmcargs=root=/dev/mmcblk0p2 rw " \ "rootfstype=ext3 rootwait\0" \ "mmcboot=echo Booting from mmc ...; " \ @@ -221,7 +218,7 @@ "bootm ${loadaddr}\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=${serverip}:${rootpath}\0" \ - "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.img\0" \ + "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.img\0" \ "uboot_addr=0x80000\0" \ "update=nandecc sw;nand erase ${uboot_addr} 100000;" \ "nand write ${loadaddr} ${uboot_addr} 80000\0" \ diff --git a/include/configs/o2d.h b/include/configs/o2d.h index eff1bcef3b..b2905b2697 100644 --- a/include/configs/o2d.h +++ b/include/configs/o2d.h @@ -43,8 +43,8 @@ #define CONFIG_BOARD_NAME "o2d" #define CONFIG_BOARD_BOOTCMD "run dhcp_boot" -#define CONFIG_BOARD_MEM_LIMIT xstr(126) -#define BOARD_POST_CRC32_END xstr(0x01000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(126) +#define BOARD_POST_CRC32_END __stringify(0x01000000) #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_IFM_DEFAULT_ENV_SETTINGS \ @@ -56,7 +56,7 @@ "ramtop=fc55ffff\0" \ "jffbot=fc560000\0" \ "jfftop=fcffffff\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=fc03ffff\0" \ "kernel_addr=0xfc060000\0" \ "ramdisk_addr=0xfc160000\0" \ diff --git a/include/configs/o2d300.h b/include/configs/o2d300.h index 1af53834f7..a8222d9f97 100644 --- a/include/configs/o2d300.h +++ b/include/configs/o2d300.h @@ -44,8 +44,8 @@ #define CONFIG_BOARD_NAME "o2d300" #define CONFIG_BOARD_BOOTCMD "run dhcp_boot" -#define CONFIG_BOARD_MEM_LIMIT xstr(126) -#define BOARD_POST_CRC32_END xstr(0x02000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(126) +#define BOARD_POST_CRC32_END __stringify(0x02000000) #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_IFM_DEFAULT_ENV_SETTINGS \ @@ -63,7 +63,7 @@ "ramtop=fc57ffff\0" \ "jffbot=fc580000\0" \ "jfftop=fd39ffff\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=fc03ffff\0" \ "halname="CONFIG_BOARD_NAME"/"CONFIG_BOARD_NAME"_halcon\0" \ "halbot=fd3a0000\0" \ diff --git a/include/configs/o2dnt-common.h b/include/configs/o2dnt-common.h index 133dc6f8cd..183c449284 100644 --- a/include/configs/o2dnt-common.h +++ b/include/configs/o2dnt-common.h @@ -114,9 +114,6 @@ #undef CONFIG_BOOTARGS -#define xstr(s) str(s) -#define str(s) #s - #if !defined(CONFIG_CONSOLE_DEV) #define CONFIG_CONSOLE_DEV "ttyPSC1" #endif @@ -158,7 +155,7 @@ "kernel_addr_r=600000\0" \ "initrd_high=0x03e00000\0" \ "memlimit=mem="CONFIG_BOARD_MEM_LIMIT"M\0" \ - "memtest=mtest 0x00100000 "xstr(CONFIG_SYS_MEMTEST_END)" 0 1\0" \ + "memtest=mtest 0x00100000 "__stringify(CONFIG_SYS_MEMTEST_END)" 0 1\0" \ "netdev=eth0\0" \ "nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsroot=${serverip}:${rootpath}\0" \ @@ -182,7 +179,7 @@ "unlock=yes\0" \ "post=echo !!! "CONFIG_BOARD_NAME" POWER ON SELF TEST !!!;" \ "setenv bootdelay 1;" \ - "crc32 "xstr(CONFIG_SYS_TEXT_BASE)" " \ + "crc32 "__stringify(CONFIG_SYS_TEXT_BASE)" " \ BOARD_POST_CRC32_END";" \ "setenv bootcmd "CONFIG_BOARD_BOOTCMD";saveenv;reset\0" diff --git a/include/configs/o2dnt2.h b/include/configs/o2dnt2.h index 3636c0e1d4..1b765a7e4e 100644 --- a/include/configs/o2dnt2.h +++ b/include/configs/o2dnt2.h @@ -43,8 +43,8 @@ #define CONFIG_BOARD_NAME "o2dnt2" #define CONFIG_BOARD_BOOTCMD "run flash_self" -#define CONFIG_BOARD_MEM_LIMIT xstr(126) -#define BOARD_POST_CRC32_END xstr(0x01000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(126) +#define BOARD_POST_CRC32_END __stringify(0x01000000) #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_IFM_DEFAULT_ENV_SETTINGS \ @@ -56,7 +56,7 @@ "ramtop=fc55ffff\0" \ "jffbot=fc560000\0" \ "jfftop=fce5ffff\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=fc03ffff\0" \ "calname="CONFIG_BOARD_NAME"/uCal_"CONFIG_BOARD_NAME"_act\0" \ "calbot=fce60000\0" \ diff --git a/include/configs/o2i.h b/include/configs/o2i.h index 8fe1da58bb..c0fcedaf10 100644 --- a/include/configs/o2i.h +++ b/include/configs/o2i.h @@ -37,8 +37,8 @@ #define CONFIG_BOARD_NAME "o2i" #define CONFIG_BOARD_BOOTCMD "run dhcp_boot" -#define CONFIG_BOARD_MEM_LIMIT xstr(62) -#define BOARD_POST_CRC32_END xstr(0x01000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(62) +#define BOARD_POST_CRC32_END __stringify(0x01000000) #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_IFM_DEFAULT_ENV_SETTINGS \ @@ -52,7 +52,7 @@ "jfftop=ffebffff\0" \ "kernel_addr=0xff060000\0" \ "ramdisk_addr=0xff160000\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=ff03ffff\0" \ "autoload=no\0" \ "dhcp_boot=run dhcpcmd; run flash_mtd\0" \ diff --git a/include/configs/o2mnt.h b/include/configs/o2mnt.h index c2164b5efb..eb63cb0c85 100644 --- a/include/configs/o2mnt.h +++ b/include/configs/o2mnt.h @@ -39,8 +39,8 @@ #define CONFIG_BOARD_NAME "o2mnt" #define CONFIG_BOARD_BOOTCMD "${newcmd}" -#define CONFIG_BOARD_MEM_LIMIT xstr(62) -#define BOARD_POST_CRC32_END xstr(0x01000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(62) +#define BOARD_POST_CRC32_END __stringify(0x01000000) #ifndef CONFIG_IFM_SENSOR_TYPE #define CONFIG_IFM_SENSOR_TYPE "O2M110" @@ -56,7 +56,7 @@ "ramtop=ffc5ffff\0" \ "jffbot=ffc60000\0" \ "jfftop=ffffffff\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=ff03ffff\0" \ "kernel_addr=0xff060000\0" \ "ramdisk_addr=0xff260000\0" \ diff --git a/include/configs/o3dnt.h b/include/configs/o3dnt.h index 05cd360815..77907507b3 100644 --- a/include/configs/o3dnt.h +++ b/include/configs/o3dnt.h @@ -44,8 +44,8 @@ #define CONFIG_BOARD_NAME "o3dnt" #define CONFIG_BOARD_BOOTCMD "run flash_self" -#define CONFIG_BOARD_MEM_LIMIT xstr(62) -#define BOARD_POST_CRC32_END xstr(0x01000000) +#define CONFIG_BOARD_MEM_LIMIT __stringify(62) +#define BOARD_POST_CRC32_END __stringify(0x01000000) #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_IFM_DEFAULT_ENV_SETTINGS \ @@ -57,7 +57,7 @@ "ramtop=fc55ffff\0" \ "jffbot=fc560000\0" \ "jfftop=fce5ffff\0" \ - "ubobot=" xstr(CONFIG_SYS_FLASH_BASE) "\0" \ + "ubobot=" __stringify(CONFIG_SYS_FLASH_BASE) "\0" \ "ubotop=fc03ffff\0" \ "calname="CONFIG_BOARD_NAME"/uCal_"CONFIG_BOARD_NAME"_act\0" \ "calbot=fce60000\0" \ diff --git a/include/configs/woodburn_common.h b/include/configs/woodburn_common.h index 259205e881..d3d3e694cd 100644 --- a/include/configs/woodburn_common.h +++ b/include/configs/woodburn_common.h @@ -242,8 +242,6 @@ * Default environment and default scripts * to update uboot and load kernel */ -#define xstr(s) str(s) -#define str(s) #s #define CONFIG_HOSTNAME woodburn #define CONFIG_EXTRA_ENV_SETTINGS \ @@ -263,9 +261,9 @@ "addmisc=setenv bootargs ${bootargs} ${misc}\0" \ "loadaddr=80800000\0" \ "kernel_addr_r=80800000\0" \ - "hostname=" xstr(CONFIG_HOSTNAME) "\0" \ - "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0" \ - "ramdisk_file=" xstr(CONFIG_HOSTNAME) "/uRamdisk\0" \ + "hostname=" __stringify(CONFIG_HOSTNAME) "\0" \ + "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage\0" \ + "ramdisk_file=" __stringify(CONFIG_HOSTNAME) "/uRamdisk\0" \ "flash_self=run ramargs addip addtty addmtd addmisc;" \ "bootm ${kernel_addr} ${ramdisk_addr}\0" \ "flash_nfs=run nfsargs addip addtty addmtd addmisc;" \ @@ -279,9 +277,9 @@ "run ramargs addip addtty addmtd addmisc;" \ "bootm ${kernel_addr_r} ${ramdisk_addr_r};" \ "else echo Images not loades;fi\0" \ - "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \ + "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.bin\0" \ "load=tftp ${loadaddr} ${u-boot}\0" \ - "uboot_addr=" xstr(CONFIG_SYS_MONITOR_BASE) "\0" \ + "uboot_addr=" __stringify(CONFIG_SYS_MONITOR_BASE) "\0" \ "update=protect off ${uboot_addr} +80000;" \ "erase ${uboot_addr} +80000;" \ "cp.b ${loadaddr} ${uboot_addr} ${filesize}\0" \ diff --git a/include/configs/x600.h b/include/configs/x600.h index 71373e98f9..6214dc480a 100644 --- a/include/configs/x600.h +++ b/include/configs/x600.h @@ -181,26 +181,24 @@ #define CONFIG_UBI_PART ubi0 #define CONFIG_UBIFS_VOLUME rootfs -#define xstr(s) str(s) -#define str(s) #s - #define MTDIDS_DEFAULT "nand0=nand" #define MTDPARTS_DEFAULT "mtdparts=nand:64M(ubi0),64M(ubi1)" #define CONFIG_EXTRA_ENV_SETTINGS \ "u-boot_addr=1000000\0" \ - "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.spr\0" \ + "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.spr\0" \ "load=tftp ${u-boot_addr} ${u-boot}\0" \ - "update=protect off " xstr(CONFIG_SYS_MONITOR_BASE) " +${filesize};"\ - "erase " xstr(CONFIG_SYS_MONITOR_BASE) " +${filesize};" \ - "cp.b ${u-boot_addr} " xstr(CONFIG_SYS_MONITOR_BASE) \ + "update=protect off " __stringify(CONFIG_SYS_MONITOR_BASE) \ + " +${filesize};" \ + "erase " __stringify(CONFIG_SYS_MONITOR_BASE) " +${filesize};" \ + "cp.b ${u-boot_addr} " __stringify(CONFIG_SYS_MONITOR_BASE) \ " ${filesize};" \ - "protect on " xstr(CONFIG_SYS_MONITOR_BASE) \ + "protect on " __stringify(CONFIG_SYS_MONITOR_BASE) \ " +${filesize}\0" \ "upd=run load update\0" \ - "ubifs=" xstr(CONFIG_HOSTNAME) "/ubifs.img\0" \ - "part=" xstr(CONFIG_UBI_PART) "\0" \ - "vol=" xstr(CONFIG_UBIFS_VOLUME) "\0" \ + "ubifs=" __stringify(CONFIG_HOSTNAME) "/ubifs.img\0" \ + "part=" __stringify(CONFIG_UBI_PART) "\0" \ + "vol=" __stringify(CONFIG_UBIFS_VOLUME) "\0" \ "load_ubifs=tftp ${kernel_addr} ${ubifs}\0" \ "update_ubifs=ubi part ${part};ubi write ${kernel_addr} ${vol}" \ " ${filesize}\0" \ @@ -223,11 +221,12 @@ "saveenv;boot\0" \ "ubifsargs=set bootargs ubi.mtd=ubi${boot_part} " \ "root=ubi0:rootfs rootfstype=ubifs\0" \ - "kernel=" xstr(CONFIG_HOSTNAME) "/uImage\0" \ + "kernel=" __stringify(CONFIG_HOSTNAME) "/uImage\0" \ "kernel_fs=/boot/uImage \0" \ "kernel_addr=1000000\0" \ - "dtb=" xstr(CONFIG_HOSTNAME) "/" xstr(CONFIG_HOSTNAME) ".dtb\0" \ - "dtb_fs=/boot/" xstr(CONFIG_HOSTNAME) ".dtb\0" \ + "dtb=" __stringify(CONFIG_HOSTNAME) "/" \ + __stringify(CONFIG_HOSTNAME) ".dtb\0" \ + "dtb_fs=/boot/" __stringify(CONFIG_HOSTNAME) ".dtb\0" \ "dtb_addr=1800000\0" \ "load_kernel=tftp ${kernel_addr} ${kernel}\0" \ "load_dtb=tftp ${dtb_addr} ${dtb}\0" \ -- 2.39.5