Initial Contribution

msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
diff --git a/mm/sparse.c b/mm/sparse.c
index aa64b12..8193ed8 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -121,8 +121,10 @@
 int __section_nr(struct mem_section* ms)
 {
 	unsigned long root_nr;
-	struct mem_section* root;
+	struct mem_section *root;
 
+	if (NR_SECTION_ROOTS == 0)
+		return ms - __nr_to_section(0);
 	for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) {
 		root = __nr_to_section(root_nr * SECTIONS_PER_ROOT);
 		if (!root)