]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
kbuild: force to define __UBOOT__ in all the C sources
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Sun, 31 Aug 2014 06:16:53 +0000 (15:16 +0900)
committerTom Rini <trini@ti.com>
Tue, 16 Sep 2014 16:23:56 +0000 (12:23 -0400)
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>
56 files changed:
Makefile
drivers/mtd/mtdconcat.c
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_bbt.c
drivers/mtd/nand/nand_ids.c
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/build.c
drivers/mtd/ubi/crc32.c
drivers/mtd/ubi/debug.c
drivers/mtd/ubi/debug.h
drivers/mtd/ubi/eba.c
drivers/mtd/ubi/fastmap.c
drivers/mtd/ubi/io.c
drivers/mtd/ubi/kapi.c
drivers/mtd/ubi/ubi.h
drivers/mtd/ubi/upd.c
drivers/mtd/ubi/vmt.c
drivers/mtd/ubi/vtbl.c
drivers/mtd/ubi/wl.c
drivers/usb/musb-new/am35x.c
drivers/usb/musb-new/musb_core.c
drivers/usb/musb-new/musb_dsps.c
drivers/usb/musb-new/musb_gadget.c
drivers/usb/musb-new/musb_gadget_ep0.c
drivers/usb/musb-new/musb_host.c
drivers/usb/musb-new/musb_uboot.c
drivers/usb/musb-new/omap2430.c
fs/ubifs/budget.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/io.c
fs/ubifs/log.c
fs/ubifs/lprops.c
fs/ubifs/lpt.c
fs/ubifs/lpt_commit.c
fs/ubifs/master.c
fs/ubifs/misc.h
fs/ubifs/recovery.c
fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/scan.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/tnc_misc.c
fs/ubifs/ubifs.c
fs/ubifs/ubifs.h
include/linux/mtd/flashchip.h
include/linux/mtd/mtd.h
include/linux/mtd/nand.h
include/linux/mtd/ubi.h
include/linux/rbtree.h
include/mtd/mtd-abi.h
lib/list_sort.c
lib/rbtree.c

index 42263e4de28cf86d1a01d665fb9b5ea666650ecf..62b202fb11efcc766e3ca566e63ee17c47f9afe4 100644 (file)
--- 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 \
index 39daeabd9f1e578741fc2a2403ae7d353c8fef05..3e36918f1cd8e5c59782555e27d5f44eec503370 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/module.h>
index 6ad03575f64e75d281ff258732ea2ca884172d18..e0b7e3af72f37e3720f89f9d9044dd9248e35c25 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>
index 2f20b92a8825896f9dc3330453beeb6580e95240..cfbaa3d9a0cbbfda3e6dda66dd889a20c95aca31 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/types.h>
index 085b1541cda9c6f721663a01e520bd3e959f5acd..7153e3ca3630a2219d09dfca487cc7dcafa00a55 100644 (file)
@@ -29,7 +29,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
index c8f28c792b2a3e21c919be0a725aca19fe794a28..cf4a82d93a929904560ebaad71c0be5018a04c10 100644 (file)
@@ -59,7 +59,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/types.h>
index 54f9f138967fa29465559751f91fc2779cb4ff2d..9ed05778d371b1b7780859405e22bbfcbb6d44b4 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  *
  */
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/mtd/nand.h>
index 9fce02ef267ae11d1e3039bbcd3d386c33e24092..1bdbfa71d910dba3fbef88b1d94cbf2fd1fb9c50 100644 (file)
@@ -70,7 +70,6 @@
  *   o Otherwise this is corruption type 2.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/err.h>
 #include <linux/slab.h>
index ff8bf0cedfcb6faed7591c7fca71abb48206be43..584cf5f22b38f4830ced26e6e011df1bd3115ac5 100644 (file)
@@ -17,7 +17,6 @@
  * later using the "UBI control device".
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 0d65bf4b8a562f5cbc4549520cb0deedd40b21e7..9c54ea4db0c74f004840f76e830e746c52ede92c 100644 (file)
@@ -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>
index af254da4883c375cc9dd39efdb4df43c6454ea46..6dcc4e4844bd33a3bdaccdd3b2a564a89452fcc7 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <ubi_uboot.h>
 #include "ubi.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/debugfs.h>
 #include <linux/uaccess.h>
index 980eb11ed235c50df8e1a6a1b129df22b3ac2435..bfa9dfb42bd411c9c7a651e1eed6be5ecee80b2e 100644 (file)
@@ -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
index 3c2a7e69e1841aa587b6fd6a2e7bf2d4f3f7650b..fce0ff8bdf010d9de6d7058cd36c6e42a76501e3 100644 (file)
@@ -29,7 +29,6 @@
  * 64 bits is enough to never overflow.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/crc32.h>
index 787522fa2ebfb2307c9034cc5a910db0c8949bd2..a2166e431c22fc463280958db829cf1b9baf0f63 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #else
index 41d7eb763885ae3c527aa4b89c43614c3730e65b..0e2e9335fe5cc16fb25933fa3b2cfe9cdcd313ac 100644 (file)
@@ -73,7 +73,6 @@
  * back and writes the whole sub-page.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/err.h>
index 0183c93b0b040560f43c7275844ccadf67b57e5a..fd2bbd64f13835d67e25ad5275d550b3a1ca8058 100644 (file)
@@ -8,7 +8,6 @@
 
 /* This file mostly implements UBI kernel API functions */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/slab.h>
index 20fd704ecafd077af9249a254bd655ad2e71f612..754b3371d25c18b0f8403d2257a1636729098743 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef __UBI_UBI_H__
 #define __UBI_UBI_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/types.h>
 #include <linux/list.h>
index 220c120515ac508f58eb9e1459cb8aed4d3eeb0e..c52c9ce776ad95fb9647e169ba90d7bccc4ce78b 100644 (file)
@@ -26,7 +26,6 @@
  * transaction with a roll-back capability.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/uaccess.h>
 #else
index d9665a446a3dbc1d5174af3dcbc0c88ba79a9170..f4392f59692ab0403e70935b457cc6bfd128f7c7 100644 (file)
@@ -11,7 +11,6 @@
  * resizing.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/err.h>
 #include <linux/slab.h>
index e6c8f5bbe0e00f54d32b180a95f1a9f28b7633b7..ae8ea38c625ee7b8041b683e0817e12c0d16eba1 100644 (file)
@@ -43,7 +43,6 @@
  * damaged.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/err.h>
index 102309016ac43d7a83de295218c4987b19da6c40..6886f89df25fd4db7d25c48d156d38fde3ee08a9 100644 (file)
@@ -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>
index 57c9bd393b89b5addb1b5ac98a0136383140d992..857d7eb0cce451c5d6d750cd8265867e114dd37e 100644 (file)
@@ -26,7 +26,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/init.h>
 #include <linux/module.h>
index 36681b6fc87755d7a8a08b8473f01b740a93291a..4edd6d729d1d0d26cb5d5867ebbf3e9783f6c045 100644 (file)
@@ -89,7 +89,6 @@
  * Most of the conditional compilation will (someday) vanish.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>
index 9a03917e87d6ffb169cdb19715123c616ca24547..17ed224488f3c924c2c5873e74bd49c8f880120c 100644 (file)
@@ -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>
index d2cb91a898fa07794c1ab144ba5ef1ddd676184e..97acf93d316e2111636411fd17a58f6c4f83fbc3 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/list.h>
index 8c3b0a145a4dcb126107cf20e305ecd23fdc74ef..5a715013a2315e945c0b3a2ab354a4fe533f7f46 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/list.h>
index 9a2cf59d9248364e9c53ab3f504a2980b4f0b216..bbcee88241ba33f05cafad51d3162bc63bc12021 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>
index 0d7b89fcf6e4e0fe0508c4afa0ffa4d329abcfba..2676f09c3844d159c5f15130ccdff6c287339aed 100644 (file)
@@ -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"
index b1c4dc7828518252c856e658ddf4c5c92863e1e6..98f4830912be656321f011f9dafdcdf3cfa6e60d 100644 (file)
@@ -24,7 +24,6 @@
  * Suite 330, Boston, MA  02111-1307  USA
  *
  */
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>
index 9ed40177cb993ccb4d137c9bef58eb81f8a497e9..c626cbf48430101261b3fafa9c1651f263f59a9b 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/writeback.h>
 #else
index 2f50a554bbe8dd5591410697c36be789a40cdf7c..6e6f018b2f5ed4e52d947305e6fe378549bc78b0 100644 (file)
@@ -16,7 +16,6 @@
  * various local functions of those subsystems.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/debugfs.h>
index 6d325af8bcc296305815536f748aed790e697df4..807ce1b7338033dded1ffc68c45eb0d7e53957a2 100644 (file)
@@ -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);
index f87341e1087a4b5c7ab0682ea36d4af89e20b9d7..bdccdc45e1116d67e634e1363577c8bb445357e6 100644 (file)
@@ -59,7 +59,6 @@
  * they are read from the flash media.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
index ced04240c54efa1a443ff3bc7c3192eddbbc2d04..0355fe2b048f73db36001255a5797263f4272244 100644 (file)
@@ -16,7 +16,6 @@
  * journal.
  */
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/err.h>
 #endif
index fc6686bb08b14f52a7fef241d7811764552a6897..a1a814f7797fef2fcb9c7f3977e674e2d17b64cd 100644 (file)
@@ -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
index c49d3b0687f5e11d395c476a089e1621e95b33a5..8489e90e4a353fdcb174015a6a506c7ebf6b7218 100644 (file)
@@ -33,7 +33,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc16.h>
 #include <linux/math64.h>
index cad422e06623a48254b42c51af64f764a8aeff94..c818d4ca5af83be100f963c4c45478632b719802 100644 (file)
@@ -14,7 +14,6 @@
  * subsystem.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc16.h>
 #include <linux/slab.h>
index 00ca855e818cad8f7c51017f7fa32e907972e885..761e0704e4a6c26882cb34f616e13bd77d598201 100644 (file)
@@ -11,7 +11,6 @@
 
 /* This file implements reading and writing the master node */
 
-#define __UBOOT__
 #include "ubifs.h"
 #ifdef __UBOOT__
 #include <linux/compat.h>
index 4316d3c8ae2b1ecf8ceeef53c2c9200098001452..7cad2bed1b232a767b15df87895913c37351661a 100644 (file)
@@ -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
index f54a440cd51d8a66fecb2ba3232eb570e3bd3efe..763770738b7c9eb7b91c001ca9b6349691f4481b 100644 (file)
@@ -36,7 +36,6 @@
  * refuses to mount.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
index 6393b15b1852d95300181248e114736030b9b2ac..7268b37a49c8b0a13a3e223fab6aa2a3624e0a86 100644 (file)
@@ -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>
index fc0194aa267023866ebef30eecffb74a422bb14e..4983bf62897f116b1691fdcd4bcb2a6bd33db83d 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include "ubifs.h"
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/random.h>
index 5523d4e6608f39d16e98641eb584128fc67a6e09..6fc464bb4850dce5852895cadc9e98b18489067c 100644 (file)
@@ -16,7 +16,6 @@
  * debugging functions.
  */
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/err.h>
 #endif
index dd9b668ee763f9b1d17cb8520b75af99f6bc3610..01d449a7afa4f95185e777f06db9e4f47c01d0a4 100644 (file)
@@ -15,7 +15,6 @@
  * corresponding subsystems, but most of it is here.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/init.h>
 #include <linux/slab.h>
index eda50705574d9c063bb14d77d427e1ff33631973..95cae548bf2cf4a2ef2ee7cdfa693f8221a59bec 100644 (file)
@@ -19,7 +19,6 @@
  * the mutex locked.
  */
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
index 81bdad920344b3c23563ef2814bf187fbfab9971..f808e0bc2fd14476a6d1d6445ccf1261372b595d 100644 (file)
@@ -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
index b91a6fd26f261118516ba6c49938c9ac2419ed49..49e6f469ca6c47d3b515dc2ad7308008c045ab39 100644 (file)
@@ -26,7 +26,6 @@
 #include "ubifs.h"
 #include <u-boot/zlib.h>
 
-#define __UBOOT__
 #include <linux/err.h>
 #include <linux/lzo.h>
 
index acc6a404dde477a0b161aa88ad3c89a74ca7db73..0ce2475e0b8e9a9c95650837d20fef9adbc5415b 100644 (file)
@@ -15,7 +15,6 @@
 #ifndef __UBIFS_H__
 #define __UBIFS_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <asm/div64.h>
 #include <linux/statfs.h>
index 7028ee1e77abbcbb4c22a4f35dc285a4cc80bc83..e5c7d1cf0d3754ecae8b4761dec9daf73c2c8d84 100644 (file)
@@ -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
index 1526d075c7889f04e6117d230f2982d15b7cdc5a..86664132759ec33aca7c0176c300ce6c819a3e28 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MTD_MTD_H__
 #define __MTD_MTD_H__
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/types.h>
 #include <linux/uio.h>
index 67d2651481be3357cf0937526fada71f5f8c66d4..8438490fe42029e48c8c9f1c0e23858c4d75cebd 100644 (file)
@@ -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>
index d9e58aedf6398487b705eed3ea653b80dd4b1b43..05d0ab54c0190eef14f8ae16ef70f757bfe208f9 100644 (file)
@@ -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>
index b5994e3799d9671763a4f90acc330c1964ae80a0..2cc16a3e7de49e674de3ac2c01f789b025fa9fd1 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef        _LINUX_RBTREE_H
 #define        _LINUX_RBTREE_H
 
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #endif
index b9f4bcb154bf5d073ce80286eb5b315cdf191760..0ef582aeec240aff3c32c64dd33360a74cccdeaf 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __MTD_ABI_H__
 #define __MTD_ABI_H__
 
-#define __UBOOT__
 #ifdef __UBOOT__
 #include <linux/compat.h>
 #endif
index 81de0a17de8d37452e94576ebb6eb99597f62681..e841da53ee698a508fc419a8486a0144d88bf8b6 100644 (file)
@@ -1,4 +1,3 @@
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/kernel.h>
 #include <linux/module.h>
index 9e52f70d173f137f32bc5d30a731c71b7adaffd8..5de3bf40263b819edaa7ca3913271e9971f5765d 100644 (file)
@@ -9,7 +9,6 @@
   linux/lib/rbtree.c
 */
 
-#define __UBOOT__
 #include <linux/rbtree_augmented.h>
 #ifndef __UBOOT__
 #include <linux/export.h>