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 <nramaraj@codeaurora.org>
(cherry picked from commit 1ff28b9751596dbaf55a3e40f593d3013380a3ac)
This commit is contained in:
Naveen Ramaraj
2010-07-22 16:42:05 -07:00
committed by Stephen Boyd
parent 321d16d801
commit 4fe9e26803

View File

@@ -121,8 +121,10 @@ static inline int sparse_index_init(unsigned long section_nr, int nid)
int __section_nr(struct mem_section* ms) int __section_nr(struct mem_section* ms)
{ {
unsigned long root_nr; 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++) { for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) {
root = __nr_to_section(root_nr * SECTIONS_PER_ROOT); root = __nr_to_section(root_nr * SECTIONS_PER_ROOT);
if (!root) if (!root)