From: Masahiro Yamada Date: Sun, 31 Aug 2014 06:16:53 +0000 (+0900) Subject: kbuild: force to define __UBOOT__ in all the C sources X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=3b6129702489ef4e327adeeef79ad73da8f6b59d;p=u-boot.git kbuild: force to define __UBOOT__ in all the C sources U-Boot has imported various source files from other projects, mostly Linux. Something like #ifdef __UBOOT__ [ modification for U-Boot ] #else [ original code ] #endif is an often used strategy for clarification of adjusted parts, that is, easier re-sync in future. Instead of defining __UBOOT__ in each source file, passing it from the top Makefile would be easier. Signed-off-by: Masahiro Yamada Acked-by: Marek Vasut Acked-by: Heiko Schocher --- diff --git a/Makefile b/Makefile index 42263e4de2..62b202fb11 100644 --- a/Makefile +++ b/Makefile @@ -341,7 +341,7 @@ CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF) -KBUILD_CPPFLAGS := -D__KERNEL__ +KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ -Wno-format-security \ diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 39daeabd9f..3e36918f1c 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -10,7 +10,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 6ad03575f6..e0b7e3af72 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -9,7 +9,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 2f20b92a88..cfbaa3d9a0 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -9,7 +9,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 085b1541cd..7153e3ca36 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -29,7 +29,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index c8f28c792b..cf4a82d93a 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -59,7 +59,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c index 54f9f13896..9ed05778d3 100644 --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c @@ -8,7 +8,6 @@ * published by the Free Software Foundation. * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 9fce02ef26..1bdbfa71d9 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c @@ -70,7 +70,6 @@ * o Otherwise this is corruption type 2. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index ff8bf0cedf..584cf5f22b 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -17,7 +17,6 @@ * later using the "UBI control device". */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/crc32.c b/drivers/mtd/ubi/crc32.c index 0d65bf4b8a..9c54ea4db0 100644 --- a/drivers/mtd/ubi/crc32.c +++ b/drivers/mtd/ubi/crc32.c @@ -20,7 +20,6 @@ * Version 2. See the file COPYING for more details. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index af254da488..6dcc4e4844 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c @@ -8,7 +8,6 @@ #include #include "ubi.h" -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 980eb11ed2..bfa9dfb42b 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -13,7 +13,6 @@ void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len); void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); -#define __UBOOT__ #ifndef __UBOOT__ #include #endif diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 3c2a7e69e1..fce0ff8bdf 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -29,7 +29,6 @@ * 64 bits is enough to never overflow. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 787522fa2e..a2166e431c 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -6,7 +6,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #else diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 41d7eb7638..0e2e9335fe 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -73,7 +73,6 @@ * back and writes the whole sub-page. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 0183c93b0b..fd2bbd64f1 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -8,7 +8,6 @@ /* This file mostly implements UBI kernel API functions */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 20fd704eca..754b3371d2 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h @@ -10,7 +10,6 @@ #ifndef __UBI_UBI_H__ #define __UBI_UBI_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c index 220c120515..c52c9ce776 100644 --- a/drivers/mtd/ubi/upd.c +++ b/drivers/mtd/ubi/upd.c @@ -26,7 +26,6 @@ * transaction with a roll-back capability. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #else diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index d9665a446a..f4392f5969 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -11,7 +11,6 @@ * resizing. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index e6c8f5bbe0..ae8ea38c62 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -43,7 +43,6 @@ * damaged. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 102309016a..6886f89df2 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -86,7 +86,6 @@ * room for future re-works of the WL sub-system. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c index 57c9bd393b..857d7eb0cc 100644 --- a/drivers/usb/musb-new/am35x.c +++ b/drivers/usb/musb-new/am35x.c @@ -26,7 +26,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c index 36681b6fc8..4edd6d729d 100644 --- a/drivers/usb/musb-new/musb_core.c +++ b/drivers/usb/musb-new/musb_core.c @@ -89,7 +89,6 @@ * Most of the conditional compilation will (someday) vanish. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c index 9a03917e87..17ed224488 100644 --- a/drivers/usb/musb-new/musb_dsps.c +++ b/drivers/usb/musb-new/musb_dsps.c @@ -29,7 +29,6 @@ * da8xx.c would be merged to this file after testing. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_gadget.c b/drivers/usb/musb-new/musb_gadget.c index d2cb91a898..97acf93d31 100644 --- a/drivers/usb/musb-new/musb_gadget.c +++ b/drivers/usb/musb-new/musb_gadget.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c b/drivers/usb/musb-new/musb_gadget_ep0.c index 8c3b0a145a..5a715013a2 100644 --- a/drivers/usb/musb-new/musb_gadget_ep0.c +++ b/drivers/usb/musb-new/musb_gadget_ep0.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_host.c b/drivers/usb/musb-new/musb_host.c index 9a2cf59d92..bbcee88241 100644 --- a/drivers/usb/musb-new/musb_host.c +++ b/drivers/usb/musb-new/musb_host.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index 0d7b89fcf6..2676f09c38 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -4,7 +4,6 @@ #include #include -#define __UBOOT__ #include #include "linux-compat.h" #include "usb-compat.h" diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index b1c4dc7828..98f4830912 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -24,7 +24,6 @@ * Suite 330, Boston, MA 02111-1307 USA * */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index 9ed40177cb..c626cbf484 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c @@ -20,7 +20,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include #else diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 2f50a554bb..6e6f018b2f 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -16,7 +16,6 @@ * various local functions of those subsystems. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 6d325af8bc..807ce1b733 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h @@ -12,7 +12,6 @@ #ifndef __UBIFS_DEBUG_H__ #define __UBIFS_DEBUG_H__ -#define __UBOOT__ /* Checking helper functions */ typedef int (*dbg_leaf_callback)(struct ubifs_info *c, struct ubifs_zbranch *zbr, void *priv); diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index f87341e108..bdccdc45e1 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -59,7 +59,6 @@ * they are read from the flash media. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c index ced04240c5..0355fe2b04 100644 --- a/fs/ubifs/log.c +++ b/fs/ubifs/log.c @@ -16,7 +16,6 @@ * journal. */ -#define __UBOOT__ #ifdef __UBOOT__ #include #endif diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index fc6686bb08..a1a814f779 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -17,7 +17,6 @@ * an empty LEB for the journal, or a very dirty LEB for garbage collection. */ -#define __UBOOT__ #ifdef __UBOOT__ #include #endif diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index c49d3b0687..8489e90e4a 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c @@ -33,7 +33,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index cad422e066..c818d4ca5a 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c @@ -14,7 +14,6 @@ * subsystem. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c index 00ca855e81..761e0704e4 100644 --- a/fs/ubifs/master.c +++ b/fs/ubifs/master.c @@ -11,7 +11,6 @@ /* This file implements reading and writing the master node */ -#define __UBOOT__ #include "ubifs.h" #ifdef __UBOOT__ #include diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 4316d3c8ae..7cad2bed1b 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -16,7 +16,6 @@ #ifndef __UBIFS_MISC_H__ #define __UBIFS_MISC_H__ -#define __UBOOT__ /** * ubifs_zn_dirty - check if znode is dirty. * @znode: znode to check diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index f54a440cd5..763770738b 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -36,7 +36,6 @@ * refuses to mount. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 6393b15b18..7268b37a49 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -21,7 +21,6 @@ * larger is the journal, the more memory its index may consume. */ -#define __UBOOT__ #ifdef __UBOOT__ #include #include diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index fc0194aa26..4983bf6289 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -16,7 +16,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 5523d4e660..6fc464bb48 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -16,7 +16,6 @@ * debugging functions. */ -#define __UBOOT__ #ifdef __UBOOT__ #include #endif diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index dd9b668ee7..01d449a7af 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -15,7 +15,6 @@ * corresponding subsystems, but most of it is here. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index eda5070557..95cae548bf 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -19,7 +19,6 @@ * the mutex locked. */ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/fs/ubifs/tnc_misc.c b/fs/ubifs/tnc_misc.c index 81bdad9203..f808e0bc2f 100644 --- a/fs/ubifs/tnc_misc.c +++ b/fs/ubifs/tnc_misc.c @@ -16,7 +16,6 @@ * putting it all in one file would make that file too big and unreadable. */ -#define __UBOOT__ #ifdef __UBOOT__ #include #endif diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index b91a6fd26f..49e6f469ca 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -26,7 +26,6 @@ #include "ubifs.h" #include -#define __UBOOT__ #include #include diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index acc6a404dd..0ce2475e0b 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -15,7 +15,6 @@ #ifndef __UBIFS_H__ #define __UBIFS_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index 7028ee1e77..e5c7d1cf0d 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h @@ -9,7 +9,6 @@ #ifndef __MTD_FLASHCHIP_H__ #define __MTD_FLASHCHIP_H__ -#define __UBOOT__ #ifndef __UBOOT__ /* For spinlocks. sched.h includes spinlock.h from whichever directory it * happens to be in - so we don't have to care whether we're on 2.2, which diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 1526d075c7..8666413275 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -8,7 +8,6 @@ #ifndef __MTD_MTD_H__ #define __MTD_MTD_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 67d2651481..8438490fe4 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -16,7 +16,6 @@ #ifndef __LINUX_MTD_NAND_H #define __LINUX_MTD_NAND_H -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index d9e58aedf6..05d0ab54c0 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h @@ -10,7 +10,6 @@ #define __LINUX_UBI_H__ #include -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index b5994e3799..2cc16a3e7d 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -17,7 +17,6 @@ #ifndef _LINUX_RBTREE_H #define _LINUX_RBTREE_H -#define __UBOOT__ #ifndef __UBOOT__ #include #endif diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index b9f4bcb154..0ef582aeec 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h @@ -8,7 +8,6 @@ #ifndef __MTD_ABI_H__ #define __MTD_ABI_H__ -#define __UBOOT__ #ifdef __UBOOT__ #include #endif diff --git a/lib/list_sort.c b/lib/list_sort.c index 81de0a17de..e841da53ee 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -1,4 +1,3 @@ -#define __UBOOT__ #ifndef __UBOOT__ #include #include diff --git a/lib/rbtree.c b/lib/rbtree.c index 9e52f70d17..5de3bf4026 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -9,7 +9,6 @@ linux/lib/rbtree.c */ -#define __UBOOT__ #include #ifndef __UBOOT__ #include