Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] Doc: fix mtrr userspace programs to build cleanly

Fix mtrr-add.c and mtrr-show.c in Doc/mtrr.txt to build cleanly.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Randy Dunlap and committed by
Linus Torvalds
235963b2 8c37bea1

+21 -2
+21 -2
Documentation/mtrr.txt
··· 138 138 139 139 */ 140 140 #include <stdio.h> 141 + #include <stdlib.h> 141 142 #include <string.h> 142 143 #include <sys/types.h> 143 144 #include <sys/stat.h> 144 145 #include <fcntl.h> 145 146 #include <sys/ioctl.h> 146 147 #include <errno.h> 147 - #define MTRR_NEED_STRINGS 148 148 #include <asm/mtrr.h> 149 149 150 150 #define TRUE 1 151 151 #define FALSE 0 152 152 #define ERRSTRING strerror (errno) 153 153 154 + static char *mtrr_strings[MTRR_NUM_TYPES] = 155 + { 156 + "uncachable", /* 0 */ 157 + "write-combining", /* 1 */ 158 + "?", /* 2 */ 159 + "?", /* 3 */ 160 + "write-through", /* 4 */ 161 + "write-protect", /* 5 */ 162 + "write-back", /* 6 */ 163 + }; 154 164 155 165 int main () 156 166 { ··· 242 232 #include <fcntl.h> 243 233 #include <sys/ioctl.h> 244 234 #include <errno.h> 245 - #define MTRR_NEED_STRINGS 246 235 #include <asm/mtrr.h> 247 236 248 237 #define TRUE 1 249 238 #define FALSE 0 250 239 #define ERRSTRING strerror (errno) 251 240 241 + static char *mtrr_strings[MTRR_NUM_TYPES] = 242 + { 243 + "uncachable", /* 0 */ 244 + "write-combining", /* 1 */ 245 + "?", /* 2 */ 246 + "?", /* 3 */ 247 + "write-through", /* 4 */ 248 + "write-protect", /* 5 */ 249 + "write-back", /* 6 */ 250 + }; 252 251 253 252 int main (int argc, char **argv) 254 253 {