summaryrefslogtreecommitdiff
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2009-01-07 18:14:39 +0300
committerBryan Wu <cooloney@kernel.org>2009-01-07 18:14:39 +0300
commit275123e8ab59ee6379dcccbd05c5fcc418801b64 (patch)
tree60fce6256d71a174097d004e31a8b60f6f194a01 /arch/blackfin
parenta1ee74ca09cb8c5929bab0b16e0c58e7c85b9414 (diff)
downloadlinux-275123e8ab59ee6379dcccbd05c5fcc418801b64.tar.xz
Blackfin arch: show_cpuinfo - consolidate ugly casts
rather than use *(unsigned int *)v everywhere, do this once with a local cpu_num variable Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/setup.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index fff8c7cf0e3e..638da7b3a653 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -1033,10 +1033,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
{
char *cpu, *mmu, *fpu, *vendor, *cache;
uint32_t revid;
-
+ int cpu_num = *(unsigned int *)v;
u_long sclk, cclk;
u_int icache_size = BFIN_ICACHESIZE / 1024, dcache_size = 0, dsup_banks = 0;
- struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, *(unsigned int *)v);
+ struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu_num);
cpu = CPU;
mmu = "none";
@@ -1055,8 +1055,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
break;
}
- seq_printf(m, "processor\t: %d\n" "vendor_id\t: %s\n",
- *(unsigned int *)v, vendor);
+ seq_printf(m, "processor\t: %d\n" "vendor_id\t: %s\n", cpu_num, vendor);
if (CPUID == bfin_cpuid())
seq_printf(m, "cpu family\t: 0x%04x\n", CPUID);
@@ -1137,9 +1136,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
BFIN_DLINES);
#ifdef __ARCH_SYNC_CORE_DCACHE
- seq_printf(m,
- "SMP Dcache Flushes\t: %lu\n\n",
- per_cpu(cpu_data, *(unsigned int *)v).dcache_invld_count);
+ seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count);
#endif
#ifdef CONFIG_BFIN_ICACHE_LOCK
switch ((cpudata->imemctl >> 3) & WAYALL_L) {
@@ -1192,12 +1189,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "No Ways are locked\n");
}
#endif
- if (*(unsigned int *)v != NR_CPUS-1)
+
+ if (cpu_num != num_possible_cpus() - 1)
return 0;
-#if L2_LENGTH
- seq_printf(m, "L2 SRAM\t\t: %dKB\n", L2_LENGTH/0x400);
-#endif
+ if (L2_LENGTH)
+ seq_printf(m, "L2 SRAM\t\t: %dKB\n", L2_LENGTH/0x400);
seq_printf(m, "board name\t: %s\n", bfin_board_name);
seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n",
physical_mem_end >> 10, (void *)0, (void *)physical_mem_end);