]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/sparse.c
Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / mm / sparse.c
index 1c91f0d3f6ab4a16476a0953d02b8e61331521ac..308d50331bc353e69f00b8ef7ea78555b1426224 100644 (file)
@@ -79,7 +79,6 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
 {
        unsigned long root = SECTION_NR_TO_ROOT(section_nr);
        struct mem_section *section;
-       int ret = 0;
 
        if (mem_section[root])
                return -EEXIST;
@@ -90,7 +89,7 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
 
        mem_section[root] = section;
 
-       return ret;
+       return 0;
 }
 #else /* !SPARSEMEM_EXTREME */
 static inline int sparse_index_init(unsigned long section_nr, int nid)
@@ -481,6 +480,9 @@ void __init sparse_init(void)
        struct page **map_map;
 #endif
 
+       /* see include/linux/mmzone.h 'struct mem_section' definition */
+       BUILD_BUG_ON(!is_power_of_2(sizeof(struct mem_section)));
+
        /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */
        set_pageblock_order();
 
@@ -751,6 +753,7 @@ out:
        return ret;
 }
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
 #ifdef CONFIG_MEMORY_FAILURE
 static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
 {
@@ -772,7 +775,6 @@ static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
 }
 #endif
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
 static void free_section_usemap(struct page *memmap, unsigned long *usemap)
 {
        struct page *usemap_page;