Browse Source

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 <yamada.m@jp.panasonic.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
Masahiro Yamada 9 years ago
parent
commit
3b61297024
56 changed files with 1 additions and 56 deletions
  1. 1 1
      Makefile
  2. 0 1
      drivers/mtd/mtdconcat.c
  3. 0 1
      drivers/mtd/mtdcore.c
  4. 0 1
      drivers/mtd/mtdpart.c
  5. 0 1
      drivers/mtd/nand/nand_base.c
  6. 0 1
      drivers/mtd/nand/nand_bbt.c
  7. 0 1
      drivers/mtd/nand/nand_ids.c
  8. 0 1
      drivers/mtd/ubi/attach.c
  9. 0 1
      drivers/mtd/ubi/build.c
  10. 0 1
      drivers/mtd/ubi/crc32.c
  11. 0 1
      drivers/mtd/ubi/debug.c
  12. 0 1
      drivers/mtd/ubi/debug.h
  13. 0 1
      drivers/mtd/ubi/eba.c
  14. 0 1
      drivers/mtd/ubi/fastmap.c
  15. 0 1
      drivers/mtd/ubi/io.c
  16. 0 1
      drivers/mtd/ubi/kapi.c
  17. 0 1
      drivers/mtd/ubi/ubi.h
  18. 0 1
      drivers/mtd/ubi/upd.c
  19. 0 1
      drivers/mtd/ubi/vmt.c
  20. 0 1
      drivers/mtd/ubi/vtbl.c
  21. 0 1
      drivers/mtd/ubi/wl.c
  22. 0 1
      drivers/usb/musb-new/am35x.c
  23. 0 1
      drivers/usb/musb-new/musb_core.c
  24. 0 1
      drivers/usb/musb-new/musb_dsps.c
  25. 0 1
      drivers/usb/musb-new/musb_gadget.c
  26. 0 1
      drivers/usb/musb-new/musb_gadget_ep0.c
  27. 0 1
      drivers/usb/musb-new/musb_host.c
  28. 0 1
      drivers/usb/musb-new/musb_uboot.c
  29. 0 1
      drivers/usb/musb-new/omap2430.c
  30. 0 1
      fs/ubifs/budget.c
  31. 0 1
      fs/ubifs/debug.c
  32. 0 1
      fs/ubifs/debug.h
  33. 0 1
      fs/ubifs/io.c
  34. 0 1
      fs/ubifs/log.c
  35. 0 1
      fs/ubifs/lprops.c
  36. 0 1
      fs/ubifs/lpt.c
  37. 0 1
      fs/ubifs/lpt_commit.c
  38. 0 1
      fs/ubifs/master.c
  39. 0 1
      fs/ubifs/misc.h
  40. 0 1
      fs/ubifs/recovery.c
  41. 0 1
      fs/ubifs/replay.c
  42. 0 1
      fs/ubifs/sb.c
  43. 0 1
      fs/ubifs/scan.c
  44. 0 1
      fs/ubifs/super.c
  45. 0 1
      fs/ubifs/tnc.c
  46. 0 1
      fs/ubifs/tnc_misc.c
  47. 0 1
      fs/ubifs/ubifs.c
  48. 0 1
      fs/ubifs/ubifs.h
  49. 0 1
      include/linux/mtd/flashchip.h
  50. 0 1
      include/linux/mtd/mtd.h
  51. 0 1
      include/linux/mtd/nand.h
  52. 0 1
      include/linux/mtd/ubi.h
  53. 0 1
      include/linux/rbtree.h
  54. 0 1
      include/mtd/mtd-abi.h
  55. 0 1
      lib/list_sort.c
  56. 0 1
      lib/rbtree.c

+ 1 - 1
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 \

+ 0 - 1
drivers/mtd/mtdconcat.c

@@ -10,7 +10,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/module.h>

+ 0 - 1
drivers/mtd/mtdcore.c

@@ -9,7 +9,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>

+ 0 - 1
drivers/mtd/mtdpart.c

@@ -9,7 +9,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/types.h>

+ 0 - 1
drivers/mtd/nand/nand_base.c

@@ -29,7 +29,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 

+ 0 - 1
drivers/mtd/nand/nand_bbt.c

@@ -59,7 +59,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/types.h>

+ 0 - 1
drivers/mtd/nand/nand_ids.c

@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  *
  */
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/mtd/nand.h>

+ 0 - 1
drivers/mtd/ubi/attach.c

@@ -70,7 +70,6 @@
  *   o Otherwise this is corruption type 2.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/err.h>
 #include <linux/slab.h>

+ 0 - 1
drivers/mtd/ubi/build.c

@@ -17,7 +17,6 @@
  * later using the "UBI control device".
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/moduleparam.h>

+ 0 - 1
drivers/mtd/ubi/crc32.c

@@ -20,7 +20,6 @@
  * Version 2.  See the file COPYING for more details.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/kernel.h>

+ 0 - 1
drivers/mtd/ubi/debug.c

@@ -8,7 +8,6 @@
 
 #include <ubi_uboot.h>
 #include "ubi.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/debugfs.h>
 #include <linux/uaccess.h>

+ 0 - 1
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 <linux/random.h>
 #endif

+ 0 - 1
drivers/mtd/ubi/eba.c

@@ -29,7 +29,6 @@
  * 64 bits is enough to never overflow.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/crc32.h>

+ 0 - 1
drivers/mtd/ubi/fastmap.c

@@ -6,7 +6,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #else

+ 0 - 1
drivers/mtd/ubi/io.c

@@ -73,7 +73,6 @@
  * back and writes the whole sub-page.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/err.h>

+ 0 - 1
drivers/mtd/ubi/kapi.c

@@ -8,7 +8,6 @@
 
 /* This file mostly implements UBI kernel API functions */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/slab.h>

+ 0 - 1
drivers/mtd/ubi/ubi.h

@@ -10,7 +10,6 @@
 #ifndef __UBI_UBI_H__
 #define __UBI_UBI_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/types.h>
 #include <linux/list.h>

+ 0 - 1
drivers/mtd/ubi/upd.c

@@ -26,7 +26,6 @@
  * transaction with a roll-back capability.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/uaccess.h>
 #else

+ 0 - 1
drivers/mtd/ubi/vmt.c

@@ -11,7 +11,6 @@
  * resizing.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/err.h>
 #include <linux/slab.h>

+ 0 - 1
drivers/mtd/ubi/vtbl.c

@@ -43,7 +43,6 @@
  * damaged.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/err.h>

+ 0 - 1
drivers/mtd/ubi/wl.c

@@ -86,7 +86,6 @@
  * room for future re-works of the WL sub-system.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/crc32.h>

+ 0 - 1
drivers/usb/musb-new/am35x.c

@@ -26,7 +26,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/init.h>
 #include <linux/module.h>

+ 0 - 1
drivers/usb/musb-new/musb_core.c

@@ -89,7 +89,6 @@
  * Most of the conditional compilation will (someday) vanish.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>

+ 0 - 1
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 <linux/init.h>
 #include <linux/io.h>

+ 0 - 1
drivers/usb/musb-new/musb_gadget.c

@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/list.h>

+ 0 - 1
drivers/usb/musb-new/musb_gadget_ep0.c

@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/list.h>

+ 0 - 1
drivers/usb/musb-new/musb_host.c

@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>

+ 0 - 1
drivers/usb/musb-new/musb_uboot.c

@@ -4,7 +4,6 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 
-#define __UBOOT__
 #include <usb.h>
 #include "linux-compat.h"
 #include "usb-compat.h"

+ 0 - 1
drivers/usb/musb-new/omap2430.c

@@ -24,7 +24,6 @@
  * Suite 330, Boston, MA  02111-1307  USA
  *
  */
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>

+ 0 - 1
fs/ubifs/budget.c

@@ -20,7 +20,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/writeback.h>
 #else

+ 0 - 1
fs/ubifs/debug.c

@@ -16,7 +16,6 @@
  * various local functions of those subsystems.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/debugfs.h>

+ 0 - 1
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);

+ 0 - 1
fs/ubifs/io.c

@@ -59,7 +59,6 @@
  * they are read from the flash media.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>

+ 0 - 1
fs/ubifs/log.c

@@ -16,7 +16,6 @@
  * journal.
  */
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/err.h>
 #endif

+ 0 - 1
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 <linux/err.h>
 #endif

+ 0 - 1
fs/ubifs/lpt.c

@@ -33,7 +33,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc16.h>
 #include <linux/math64.h>

+ 0 - 1
fs/ubifs/lpt_commit.c

@@ -14,7 +14,6 @@
  * subsystem.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc16.h>
 #include <linux/slab.h>

+ 0 - 1
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 <linux/compat.h>

+ 0 - 1
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

+ 0 - 1
fs/ubifs/recovery.c

@@ -36,7 +36,6 @@
  * refuses to mount.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>

+ 0 - 1
fs/ubifs/replay.c

@@ -21,7 +21,6 @@
  * larger is the journal, the more memory its index may consume.
  */
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/compat.h>
 #include <linux/err.h>

+ 0 - 1
fs/ubifs/sb.c

@@ -16,7 +16,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/random.h>

+ 0 - 1
fs/ubifs/scan.c

@@ -16,7 +16,6 @@
  * debugging functions.
  */
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/err.h>
 #endif

+ 0 - 1
fs/ubifs/super.c

@@ -15,7 +15,6 @@
  * corresponding subsystems, but most of it is here.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/init.h>
 #include <linux/slab.h>

+ 0 - 1
fs/ubifs/tnc.c

@@ -19,7 +19,6 @@
  * the mutex locked.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>

+ 0 - 1
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 <linux/err.h>
 #endif

+ 0 - 1
fs/ubifs/ubifs.c

@@ -26,7 +26,6 @@
 #include "ubifs.h"
 #include <u-boot/zlib.h>
 
-#define __UBOOT__
 #include <linux/err.h>
 #include <linux/lzo.h>
 

+ 0 - 1
fs/ubifs/ubifs.h

@@ -15,7 +15,6 @@
 #ifndef __UBIFS_H__
 #define __UBIFS_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <asm/div64.h>
 #include <linux/statfs.h>

+ 0 - 1
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

+ 0 - 1
include/linux/mtd/mtd.h

@@ -8,7 +8,6 @@
 #ifndef __MTD_MTD_H__
 #define __MTD_MTD_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/types.h>
 #include <linux/uio.h>

+ 0 - 1
include/linux/mtd/nand.h

@@ -16,7 +16,6 @@
 #ifndef __LINUX_MTD_NAND_H
 #define __LINUX_MTD_NAND_H
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/wait.h>
 #include <linux/spinlock.h>

+ 0 - 1
include/linux/mtd/ubi.h

@@ -10,7 +10,6 @@
 #define __LINUX_UBI_H__
 
 #include <linux/types.h>
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/ioctl.h>
 #include <mtd/ubi-user.h>

+ 0 - 1
include/linux/rbtree.h

@@ -17,7 +17,6 @@
 #ifndef	_LINUX_RBTREE_H
 #define	_LINUX_RBTREE_H
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #endif

+ 0 - 1
include/mtd/mtd-abi.h

@@ -8,7 +8,6 @@
 #ifndef __MTD_ABI_H__
 #define __MTD_ABI_H__
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/compat.h>
 #endif

+ 0 - 1
lib/list_sort.c

@@ -1,4 +1,3 @@
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/module.h>

+ 0 - 1
lib/rbtree.c

@@ -9,7 +9,6 @@
   linux/lib/rbtree.c
 */
 
-#define __UBOOT__
 #include <linux/rbtree_augmented.h>
 #ifndef __UBOOT__
 #include <linux/export.h>