lkml.org 
[lkml]   [2008]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/52] [microblaze] Cpuinfo handling

On Jan 24 2008 16:03, monstr@monstr.eu wrote:
>+
>+static char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
>+static char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
>+
I have not checked - can mark these const?



>--- /dev/null
>+++ b/arch/microblaze/kernel/cpu/cpuinfo.c
>+
>+static struct cpuinfo the_cpuinfo;
>+struct cpuinfo *cpuinfo = &the_cpuinfo;

Why is this indirection needed?

>+static struct cpu_ver_key the_cpu_ver_lookup[] = {
^const?

>+ /* These key value are as per MBV field in PVR0 */
>+ {"5.00.a", 0x01},
>+ {"5.00.b", 0x02},
>+ {"5.00.c", 0x03},
>+ {"6.00.a", 0x04},
>+ {"6.00.b", 0x06},
>+ {"7.00.a", 0x05},
>+ /* FIXME There is no keycode defined in MBV for these versions */
>+ {"2.10.a", 0x10},
>+ {"3.00.a", 0x20},
>+ {"4.00.a", 0x30},
>+ {"4.00.b", 0x40},
>+ {NULL, 0},
>+};
>+struct cpu_ver_key *cpu_ver_lookup =
>+ (struct cpu_ver_key *) the_cpu_ver_lookup;

Again an indirection. And the case, you guessed it, is redundant
(check other code too).

>+/*
>+ * FIXME Not sure if the actual key is defined by Xilinx in the PVR
>+ */
>+static struct family_string_key the_family_string_lookup[] = {
const?

>+ {"virtex2", 0x4},
>+ {"virtex2pro", 0x5},
>+ {"spartan3", 0x6},
>+ {"virtex4", 0x7},
>+ {"virtex5", 0x8},
>+ {"spartan3e", 0x9},
>+ {"spartan3a", 0xa},
>+ {"spartan3an", 0xb},
>+ /* FIXME There is no key code defined for spartan2 */
>+ {"spartan2", 0xf0},
>+ {NULL, 0},
>+};
>+struct family_string_key *family_string_lookup =
>+ (struct family_string_key *) the_family_string_lookup;

Dito.


>+#ifndef _ASM_CPUINFO_H
>+#define _ASM_CPUINFO_H
>+
>+#include <asm/prom.h>
>+
>+extern unsigned long loops_per_jiffy;
>+
>+/* CPU Version and FPGA Family code conversion table type */
>+struct cpu_ver_key {
>+ char *s;
const char *s; if you never modify s.

>+ unsigned k;
>+};
>+
>+struct family_string_key {
>+ char *s;
Dito.

>+ unsigned k;
>+};
>+


\
 
 \ /
  Last update: 2008-01-27 13:59    [W:0.240 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site