diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2009-01-07 10:14:39 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-01-07 10:14:39 -0500 |
commit | 275123e8ab59ee6379dcccbd05c5fcc418801b64 (patch) | |
tree | 60fce6256d71a174097d004e31a8b60f6f194a01 /arch/blackfin | |
parent | a1ee74ca09cb8c5929bab0b16e0c58e7c85b9414 (diff) |
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.c | 19 |
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) | |||
1033 | { | 1033 | { |
1034 | char *cpu, *mmu, *fpu, *vendor, *cache; | 1034 | char *cpu, *mmu, *fpu, *vendor, *cache; |
1035 | uint32_t revid; | 1035 | uint32_t revid; |
1036 | 1036 | int cpu_num = *(unsigned int *)v; | |
1037 | u_long sclk, cclk; | 1037 | u_long sclk, cclk; |
1038 | u_int icache_size = BFIN_ICACHESIZE / 1024, dcache_size = 0, dsup_banks = 0; | 1038 | u_int icache_size = BFIN_ICACHESIZE / 1024, dcache_size = 0, dsup_banks = 0; |
1039 | struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, *(unsigned int *)v); | 1039 | struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu_num); |
1040 | 1040 | ||
1041 | cpu = CPU; | 1041 | cpu = CPU; |
1042 | mmu = "none"; | 1042 | mmu = "none"; |
@@ -1055,8 +1055,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1055 | break; | 1055 | break; |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | seq_printf(m, "processor\t: %d\n" "vendor_id\t: %s\n", | 1058 | seq_printf(m, "processor\t: %d\n" "vendor_id\t: %s\n", cpu_num, vendor); |
1059 | *(unsigned int *)v, vendor); | ||
1060 | 1059 | ||
1061 | if (CPUID == bfin_cpuid()) | 1060 | if (CPUID == bfin_cpuid()) |
1062 | seq_printf(m, "cpu family\t: 0x%04x\n", CPUID); | 1061 | seq_printf(m, "cpu family\t: 0x%04x\n", CPUID); |
@@ -1137,9 +1136,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1137 | dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, | 1136 | dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, |
1138 | BFIN_DLINES); | 1137 | BFIN_DLINES); |
1139 | #ifdef __ARCH_SYNC_CORE_DCACHE | 1138 | #ifdef __ARCH_SYNC_CORE_DCACHE |
1140 | seq_printf(m, | 1139 | seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count); |
1141 | "SMP Dcache Flushes\t: %lu\n\n", | ||
1142 | per_cpu(cpu_data, *(unsigned int *)v).dcache_invld_count); | ||
1143 | #endif | 1140 | #endif |
1144 | #ifdef CONFIG_BFIN_ICACHE_LOCK | 1141 | #ifdef CONFIG_BFIN_ICACHE_LOCK |
1145 | switch ((cpudata->imemctl >> 3) & WAYALL_L) { | 1142 | switch ((cpudata->imemctl >> 3) & WAYALL_L) { |
@@ -1192,12 +1189,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1192 | seq_printf(m, "No Ways are locked\n"); | 1189 | seq_printf(m, "No Ways are locked\n"); |
1193 | } | 1190 | } |
1194 | #endif | 1191 | #endif |
1195 | if (*(unsigned int *)v != NR_CPUS-1) | 1192 | |
1193 | if (cpu_num != num_possible_cpus() - 1) | ||
1196 | return 0; | 1194 | return 0; |
1197 | 1195 | ||
1198 | #if L2_LENGTH | 1196 | if (L2_LENGTH) |
1199 | seq_printf(m, "L2 SRAM\t\t: %dKB\n", L2_LENGTH/0x400); | 1197 | seq_printf(m, "L2 SRAM\t\t: %dKB\n", L2_LENGTH/0x400); |
1200 | #endif | ||
1201 | seq_printf(m, "board name\t: %s\n", bfin_board_name); | 1198 | seq_printf(m, "board name\t: %s\n", bfin_board_name); |
1202 | seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n", | 1199 | seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n", |
1203 | physical_mem_end >> 10, (void *)0, (void *)physical_mem_end); | 1200 | physical_mem_end >> 10, (void *)0, (void *)physical_mem_end); |