Skip to contentSkip to conversation

-mm: constify some parts of arch/i386/kernel/cpu/

PATCH New Andreas Mohr 1 participant 1 message May 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 -mm: constify some parts of arch/i386/kernel/cpu/

Hello all,

patch run-tested on linux-2.6.17-rc4-mm3.

arch/i386/kernel/cpu/intel_cacheinfo.c +3 -3
diff -urN linux-2.6.17-rc4-mm3.orig/arch/i386/kernel/cpu/intel_cacheinfo.c linux-2.6.17-rc4-mm3.my/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -159,13 +159,13 @@
 	unsigned val;
 };
 
-static unsigned short assocs[] = {
+static const unsigned short assocs[] = {
 	[1] = 1, [2] = 2, [4] = 4, [6] = 8,
 	[8] = 16,
 	[0xf] = 0xffff // ??
 	};
-static unsigned char levels[] = { 1, 1, 2 };
-static unsigned char types[] = { 1, 2, 3 };
+static const unsigned char levels[] = { 1, 1, 2 };
+static const unsigned char types[] = { 1, 2, 3 };
 
 static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
 		       union _cpuid4_leaf_ebx *ebx,
arch/i386/kernel/cpu/proc.c +2 -2
diff -urN linux-2.6.17-rc4-mm3.orig/arch/i386/kernel/cpu/proc.c linux-2.6.17-rc4-mm3.my/arch/i386/kernel/cpu/proc.c
@@ -18,7 +18,7 @@
 	 * applications want to get the raw CPUID data, they should access
 	 * /dev/cpu/<cpu_nr>/cpuid instead.
 	 */
-	static char *x86_cap_flags[] = {
+	static const char * const x86_cap_flags[] = {
 		/* Intel-defined */
 	        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 	        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
@@ -62,7 +62,7 @@
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	};
-	static char *x86_power_flags[] = {
+	static const char * const x86_power_flags[] = {
 		"ts",	/* temperature sensor */
 		"fid",  /* frequency id control */
 		"vid",  /* voltage id control */