From 4fe9e2680389ede286f57ee3ceac23e18f3dee3f Mon Sep 17 00:00:00 2001 From: Naveen Ramaraj Date: Thu, 22 Jul 2010 16:42:05 -0700 Subject: [PATCH] msm: mm: Fix errors when turning on SPARSEMEM Carry forward the fix from 2.6.29b kernel to handle the NR_SECTION_ROOTS == 0 case when turning on SPARSEMEM on MSM. Also fix the linux coding style typos by replacing "foo* bar" with "foo *bar". Change-Id: I77f259f3d62980a37f4ae7c4680a3617c9b4f563 Signed-off-by: Naveen Ramaraj (cherry picked from commit 1ff28b9751596dbaf55a3e40f593d3013380a3ac) --- mm/sparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index a8bc7d364de..55cda7a9dfd 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -121,8 +121,10 @@ static inline int sparse_index_init(unsigned long section_nr, int nid) 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)