public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix MTRR strings definition.
@ 2004-08-23 23:23 Dave Jones
  2004-08-24  6:17 ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Jones @ 2004-08-23 23:23 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel, ak

Instead of deleting the extern from include/asm/mtrr.h, I believe
the correct fix would be to move the strings back to the include file
where they belong.
The reason behind this, is that there are userspace apps (admittedly
few, but we even ship two in Documentation/mtrr.txt) that rely upon
these definitions being in that header.  This has been broken for
all 2.6 releases so far. Patch below fixes things back the way it
was in 2.4

Andi, I don't have gcc 3.5 to hand, I trust this fixes whatever
problem you saw there too ?

		Dave

Restore mtrr_strings header definitions to how things were in 2.4

Signed-off-by: Dave Jones <davej@redhat.com>


--- latest-FC2/arch/i386/kernel/cpu/mtrr/if.c~	2004-08-24 00:13:41.419631072 +0100
+++ latest-FC2/arch/i386/kernel/cpu/mtrr/if.c	2004-08-24 00:14:13.639732872 +0100
@@ -6,6 +6,7 @@
 #include <asm/uaccess.h>
 
 #define LINE_SIZE 80
+#define MTRR_NEED_STRINGS
 
 #include <asm/mtrr.h>
 #include "mtrr.h"
@@ -16,17 +17,6 @@
 
 #define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private)
 
-static char *mtrr_strings[MTRR_NUM_TYPES] =
-{
-    "uncachable",               /* 0 */
-    "write-combining",          /* 1 */
-    "?",                        /* 2 */
-    "?",                        /* 3 */
-    "write-through",            /* 4 */
-    "write-protect",            /* 5 */
-    "write-back",               /* 6 */
-};
-
 char *mtrr_attrib_to_str(int x)
 {
 	return (x <= 6) ? mtrr_strings[x] : "?";
--- latest-FC2/include/asm-i386/mtrr.h~	2004-08-24 00:02:40.000000000 +0100
+++ latest-FC2/include/asm-i386/mtrr.h	2004-08-24 00:18:08.537023056 +0100
@@ -65,6 +65,19 @@
 #define MTRR_TYPE_WRBACK     6
 #define MTRR_NUM_TYPES       7
 
+#ifdef MTRR_NEED_STRINGS
+static char *mtrr_strings[MTRR_NUM_TYPES] =
+{
+	"uncachable",		/* 0 */
+	"write-combining",	/* 1 */
+	"?",			/* 2 */
+	"?",			/* 3 */
+	"write-through",	/* 4 */
+	"write-protect",	/* 5 */
+	"write-back",		/* 6 */
+};
+#endif
+
 #ifdef __KERNEL__
 
 /*  The following functions are for use by other drivers  */

--- latest-FC2/include/asm-x86_64/mtrr.h~	2004-08-24 00:20:17.377436336 +0100
+++ latest-FC2/include/asm-x86_64/mtrr.h	2004-08-24 00:21:04.137327752 +0100
@@ -69,6 +69,19 @@
 #define MTRR_TYPE_WRBACK     6
 #define MTRR_NUM_TYPES       7
 
+#ifdef MTRR_NEED_STRINGS
+static char *mtrr_strings[MTRR_NUM_TYPES] =
+{
+	"uncachable",		/* 0 */
+	"write-combining",	/* 1 */
+	"?",			/* 2 */
+	"?",			/* 3 */
+	"write-through",	/* 4 */
+	"write-protect",	/* 5 */
+	"write-back",		/* 6 */
+};
+#endif
+
 #ifdef __KERNEL__
 
 extern char *mtrr_strings[MTRR_NUM_TYPES];

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-24 11:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-23 23:23 Fix MTRR strings definition Dave Jones
2004-08-24  6:17 ` Andi Kleen
2004-08-24 11:00   ` Dave Jones
2004-08-24 11:17     ` Andi Kleen
2004-08-24 11:22       ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox