powerpc/cpumask: Refactor /proc/cpuinfo code
This separates the per cpu output from the summary output at the end of the file, making it easier to convert to the new cpumask API in a subsequent patch. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
64fe220c13
commit
2c2df03845
@@ -161,14 +161,8 @@ extern u32 cpu_temp_both(unsigned long cpu);
|
|||||||
DEFINE_PER_CPU(unsigned int, cpu_pvr);
|
DEFINE_PER_CPU(unsigned int, cpu_pvr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int show_cpuinfo(struct seq_file *m, void *v)
|
static void show_cpuinfo_summary(struct seq_file *m)
|
||||||
{
|
{
|
||||||
unsigned long cpu_id = (unsigned long)v - 1;
|
|
||||||
unsigned int pvr;
|
|
||||||
unsigned short maj;
|
|
||||||
unsigned short min;
|
|
||||||
|
|
||||||
if (cpu_id == NR_CPUS) {
|
|
||||||
struct device_node *root;
|
struct device_node *root;
|
||||||
const char *model = NULL;
|
const char *model = NULL;
|
||||||
#if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
|
#if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
|
||||||
@@ -197,7 +191,17 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
seq_printf(m, "Memory\t\t: %d MB\n",
|
seq_printf(m, "Memory\t\t: %d MB\n",
|
||||||
(unsigned int)(total_memory / (1024 * 1024)));
|
(unsigned int)(total_memory / (1024 * 1024)));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int show_cpuinfo(struct seq_file *m, void *v)
|
||||||
|
{
|
||||||
|
unsigned long cpu_id = (unsigned long)v - 1;
|
||||||
|
unsigned int pvr;
|
||||||
|
unsigned short maj;
|
||||||
|
unsigned short min;
|
||||||
|
|
||||||
|
if (cpu_id == NR_CPUS) {
|
||||||
|
show_cpuinfo_summary(m);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user