Changeset 37980


Ignore:
Timestamp:
2013-09-14T12:19:09+02:00 (4 years ago)
Author:
juhosg
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch

    r37974 r37980  
    128128+} 
    129129+ 
    130 +#ifdef CONFIG_MTD_ROOTFS_SPLIT 
    131130+#define ROOTFS_SPLIT_NAME "rootfs_data" 
    132131+#define ROOTFS_REMOVED_NAME "<removed>" 
     
    192191+                           split_size, false); 
    193192+} 
    194 +#endif /* CONFIG_MTD_ROOTFS_SPLIT */ 
    195 + 
    196 +#ifdef CONFIG_MTD_UIMAGE_SPLIT 
     193+ 
    197194+#define UBOOT_MAGIC    0x27051956 
     195+ 
     196+#ifdef CONFIG_MTD_UIMAGE_SPLIT_NAME 
     197+#define UIMAGE_SPLIT_NAME      CONFIG_MTD_UIMAGE_SPLIT_NAME 
     198+#else 
     199+#define UIMAGE_SPLIT_NAME      "unused" 
     200+#endif 
    198201+ 
    199202+static void split_uimage(struct mtd_info *master, struct mtd_part *part) 
     
    206209+       size_t len; 
    207210+ 
    208 +       if (strcmp(part->mtd.name, CONFIG_MTD_UIMAGE_SPLIT_NAME) != 0) 
     211+       if (strcmp(part->mtd.name, UIMAGE_SPLIT_NAME) != 0) 
    209212+               return; 
    210213+ 
     
    223226+                           part->mtd.size - len, false); 
    224227+} 
    225 +#endif 
    226228+ 
    227229+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, 
     
    241243+               rootfs_found = 1; 
    242244+ 
    243 +#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV 
    244 +               if (ROOT_DEV == 0) { 
     245+               if (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) && 
     246+                   ROOT_DEV == 0) { 
    245247+                       printk(KERN_NOTICE "mtd: partition \"rootfs\" " 
    246248+                               "set to be root filesystem\n"); 
    247249+                       ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, part->mtd.index); 
    248250+               } 
    249 +#endif 
    250 +#ifdef CONFIG_MTD_ROOTFS_SPLIT 
    251 +               split_rootfs_data(master, part); 
    252 +#endif 
    253 +       } 
    254 + 
    255 +#ifdef CONFIG_MTD_UIMAGE_SPLIT 
    256 +       split_uimage(master, part); 
    257 +#endif 
     251+ 
     252+               if (config_enabled(CONFIG_MTD_ROOTFS_SPLIT)) 
     253+                       split_rootfs_data(master, part); 
     254+       } 
     255+ 
     256+       if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT)) 
     257+               split_uimage(master, part); 
    258258+ 
    259259+       arch_split_mtd_part(master, part->mtd.name, part->offset, 
Note: See TracChangeset for help on using the changeset viewer.