Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196638
b: refs/heads/master
c: e6532c6
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed May 6, 2010
1 parent 8fbd7e8 commit 2fb0d02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c2df038450cbf628426183c9efffc17cfea3406
refs/heads/master: e6532c63cc3dbefc79936fc9c9c68a151004fe46
22 changes: 13 additions & 9 deletions trunk/arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
unsigned short maj;
unsigned short min;

if (cpu_id == NR_CPUS) {
show_cpuinfo_summary(m);
return 0;
}

/* We only show online cpus: disable preempt (overzealous, I
* knew) to prevent cpu going down. */
preempt_disable();
Expand Down Expand Up @@ -312,19 +307,28 @@ static int show_cpuinfo(struct seq_file *m, void *v)
#endif

preempt_enable();

/* If this is the last cpu, print the summary */
if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
show_cpuinfo_summary(m);

return 0;
}

static void *c_start(struct seq_file *m, loff_t *pos)
{
unsigned long i = *pos;

return i <= NR_CPUS ? (void *)(i + 1) : NULL;
if (*pos == 0) /* just in case, cpu 0 is not the first */
*pos = cpumask_first(cpu_online_mask);
else
*pos = cpumask_next(*pos - 1, cpu_online_mask);
if ((*pos) < nr_cpu_ids)
return (void *)(unsigned long)(*pos + 1);
return NULL;
}

static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
++*pos;
(*pos)++;
return c_start(m, pos);
}

Expand Down

0 comments on commit 2fb0d02

Please sign in to comment.