aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-14 10:19:09 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-09-14 10:19:09 +0000
commit9c2201ca15ecb90f3955b64e4e4f0fbd89ca9c0b (patch)
treebfeb356172b4f042c51833850c616e2511df7b08 /target/linux/generic
parentd064cd0998d8ff8b7cf701f92398699eb850934f (diff)
downloadmaster-187ad058-9c2201ca15ecb90f3955b64e4e4f0fbd89ca9c0b.tar.gz
master-187ad058-9c2201ca15ecb90f3955b64e4e4f0fbd89ca9c0b.tar.bz2
master-187ad058-9c2201ca15ecb90f3955b64e4e4f0fbd89ca9c0b.zip
generic/3.10: reduce number of ifdefs in the rootfs split code
Use the config_enabled() macro where it is possible. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37980 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch28
1 files changed, 14 insertions, 14 deletions
diff --git a/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
index 4cacf641d8..d2330ccf8c 100644
--- a/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
@@ -127,7 +127,6 @@
+ return len;
+}
+
-+#ifdef CONFIG_MTD_ROOTFS_SPLIT
+#define ROOTFS_SPLIT_NAME "rootfs_data"
+#define ROOTFS_REMOVED_NAME "<removed>"
+
@@ -191,11 +190,15 @@
+ __mtd_add_partition(master, ROOTFS_SPLIT_NAME, split_offset,
+ split_size, false);
+}
-+#endif /* CONFIG_MTD_ROOTFS_SPLIT */
+
-+#ifdef CONFIG_MTD_UIMAGE_SPLIT
+#define UBOOT_MAGIC 0x27051956
+
++#ifdef CONFIG_MTD_UIMAGE_SPLIT_NAME
++#define UIMAGE_SPLIT_NAME CONFIG_MTD_UIMAGE_SPLIT_NAME
++#else
++#define UIMAGE_SPLIT_NAME "unused"
++#endif
++
+static void split_uimage(struct mtd_info *master, struct mtd_part *part)
+{
+ struct {
@@ -205,7 +208,7 @@
+ } hdr;
+ size_t len;
+
-+ if (strcmp(part->mtd.name, CONFIG_MTD_UIMAGE_SPLIT_NAME) != 0)
++ if (strcmp(part->mtd.name, UIMAGE_SPLIT_NAME) != 0)
+ return;
+
+ if (mtd_read(master, part->offset, sizeof(hdr), &len, (void *) &hdr))
@@ -222,7 +225,6 @@
+ __mtd_add_partition(master, "rootfs", part->offset + len,
+ part->mtd.size - len, false);
+}
-+#endif
+
+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
+ int offset, int size)
@@ -240,21 +242,19 @@
+ if (!strcmp(part->mtd.name, "rootfs")) {
+ rootfs_found = 1;
+
-+#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV
-+ if (ROOT_DEV == 0) {
++ if (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
++ ROOT_DEV == 0) {
+ printk(KERN_NOTICE "mtd: partition \"rootfs\" "
+ "set to be root filesystem\n");
+ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, part->mtd.index);
+ }
-+#endif
-+#ifdef CONFIG_MTD_ROOTFS_SPLIT
-+ split_rootfs_data(master, part);
-+#endif
++
++ if (config_enabled(CONFIG_MTD_ROOTFS_SPLIT))
++ split_rootfs_data(master, part);
+ }
+
-+#ifdef CONFIG_MTD_UIMAGE_SPLIT
-+ split_uimage(master, part);
-+#endif
++ if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT))
++ split_uimage(master, part);
+
+ arch_split_mtd_part(master, part->mtd.name, part->offset,
+ part->mtd.size);