Commit ab14398abd195af91a744c320a52a1bce814dd1e

Authored by Cyrill Gorcunov
Committed by Ingo Molnar
1 parent 8fd2d2d5aa

x86: setup_per_cpu_areas() cleanup

Impact: cleanup

__alloc_bootmem and __alloc_bootmem_node do panic
for us in case of fail so no need for additional
checks here.

Also lets use pr_*() macros for printing.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 8 additions and 17 deletions Side-by-side Diff

arch/x86/kernel/setup_percpu.c
... ... @@ -153,12 +153,10 @@
153 153 align = max_t(unsigned long, PAGE_SIZE, align);
154 154 size = roundup(old_size, align);
155 155  
156   - printk(KERN_INFO
157   - "NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
  156 + pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
158 157 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
159 158  
160   - printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
161   - size);
  159 + pr_info("PERCPU: Allocating %zd bytes of per cpu data\n", size);
162 160  
163 161 for_each_possible_cpu(cpu) {
164 162 #ifndef CONFIG_NEED_MULTIPLE_NODES
165 163  
166 164  
... ... @@ -169,22 +167,15 @@
169 167 if (!node_online(node) || !NODE_DATA(node)) {
170 168 ptr = __alloc_bootmem(size, align,
171 169 __pa(MAX_DMA_ADDRESS));
172   - printk(KERN_INFO
173   - "cpu %d has no node %d or node-local memory\n",
  170 + pr_info("cpu %d has no node %d or node-local memory\n",
174 171 cpu, node);
175   - if (ptr)
176   - printk(KERN_DEBUG
177   - "per cpu data for cpu%d at %016lx\n",
178   - cpu, __pa(ptr));
179   - }
180   - else {
  172 + pr_debug("per cpu data for cpu%d at %016lx\n",
  173 + cpu, __pa(ptr));
  174 + } else {
181 175 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align,
182 176 __pa(MAX_DMA_ADDRESS));
183   - if (ptr)
184   - printk(KERN_DEBUG
185   - "per cpu data for cpu%d on node%d "
186   - "at %016lx\n",
187   - cpu, node, __pa(ptr));
  177 + pr_debug("per cpu data for cpu%d on node%d at %016lx\n",
  178 + cpu, node, __pa(ptr));
188 179 }
189 180 #endif
190 181 per_cpu_offset(cpu) = ptr - __per_cpu_start;