[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0801271352510.1185@fbirervta.pbzchgretzou.qr>
Date: Sun, 27 Jan 2008 13:55:50 +0100 (CET)
From: Jan Engelhardt <jengelh@...putergmbh.de>
To: monstr@...str.eu
cc: linux-kernel@...r.kernel.org, stephen.neuendorffer@...inx.com,
john.williams@...alogix.com, microblaze-uclinux@...e.uq.edu.au,
microblaze <microblaze@...alhost.localdomain.monstr.eu>
Subject: Re: [PATCH 03/52] [microblaze] Cpuinfo handling
On Jan 24 2008 16:03, monstr@...str.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;
>+};
>+
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists