diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/mm/init.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index f146071a4b2a..973c4e122f28 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -122,24 +122,19 @@ static void __init read_obp_memory(const char *property, | |||
122 | size = 0UL; | 122 | size = 0UL; |
123 | base = new_base; | 123 | base = new_base; |
124 | } | 124 | } |
125 | regs[i].phys_addr = base; | 125 | if (size == 0UL) { |
126 | regs[i].reg_size = size; | 126 | /* If it is empty, simply get rid of it. |
127 | } | 127 | * This simplifies the logic of the other |
128 | 128 | * functions that process these arrays. | |
129 | for (i = 0; i < ents; i++) { | 129 | */ |
130 | if (regs[i].reg_size == 0UL) { | 130 | memmove(®s[i], ®s[i + 1], |
131 | int j; | 131 | (ents - i - 1) * sizeof(regs[0])); |
132 | |||
133 | for (j = i; j < ents - 1; j++) { | ||
134 | regs[j].phys_addr = | ||
135 | regs[j+1].phys_addr; | ||
136 | regs[j].reg_size = | ||
137 | regs[j+1].reg_size; | ||
138 | } | ||
139 | |||
140 | ents--; | ||
141 | i--; | 132 | i--; |
133 | ents--; | ||
134 | continue; | ||
142 | } | 135 | } |
136 | regs[i].phys_addr = base; | ||
137 | regs[i].reg_size = size; | ||
143 | } | 138 | } |
144 | 139 | ||
145 | *num_ents = ents; | 140 | *num_ents = ents; |