aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mtrr/if.c
diff options
context:
space:
mode:
authorPaul Jimenez <pj@place.org>2008-01-30 07:30:31 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:31 -0500
commit2d2ee8de5f6d26ef2942e0b449aa68d9236d5777 (patch)
tree09589fa4f7386b9bc2c0ac07aa5a272396286d35 /arch/x86/kernel/cpu/mtrr/if.c
parent3e7593966be6f6d29a15138c0c96b961d437f2f5 (diff)
x86: mtrr use type bool [RESEND AGAIN]
This is a janitorish patch to 1) remove private TRUE/FALSE #def's in favor of using the standard enum from linux/stddef.h and 2) switch the variables holding those values to type 'bool' (from linux/types.h) since it both seems more appropriate and allows for potentially better optimization. As a truly minor aside, I removed a couple of comments documenting a 'do_safe' parameter that seems to no longer exist. Signed-off-by: Paul Jimenez <pj@place.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/mtrr/if.c')
-rw-r--r--arch/x86/kernel/cpu/mtrr/if.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index c7d8f175674..14535686c09 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -37,7 +37,7 @@ const char *mtrr_attrib_to_str(int x)
37 37
38static int 38static int
39mtrr_file_add(unsigned long base, unsigned long size, 39mtrr_file_add(unsigned long base, unsigned long size,
40 unsigned int type, char increment, struct file *file, int page) 40 unsigned int type, bool increment, struct file *file, int page)
41{ 41{
42 int reg, max; 42 int reg, max;
43 unsigned int *fcount = FILE_FCOUNT(file); 43 unsigned int *fcount = FILE_FCOUNT(file);
@@ -55,7 +55,7 @@ mtrr_file_add(unsigned long base, unsigned long size,
55 base >>= PAGE_SHIFT; 55 base >>= PAGE_SHIFT;
56 size >>= PAGE_SHIFT; 56 size >>= PAGE_SHIFT;
57 } 57 }
58 reg = mtrr_add_page(base, size, type, 1); 58 reg = mtrr_add_page(base, size, type, true);
59 if (reg >= 0) 59 if (reg >= 0)
60 ++fcount[reg]; 60 ++fcount[reg];
61 return reg; 61 return reg;
@@ -141,7 +141,7 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
141 size >>= PAGE_SHIFT; 141 size >>= PAGE_SHIFT;
142 err = 142 err =
143 mtrr_add_page((unsigned long) base, (unsigned long) size, i, 143 mtrr_add_page((unsigned long) base, (unsigned long) size, i,
144 1); 144 true);
145 if (err < 0) 145 if (err < 0)
146 return err; 146 return err;
147 return len; 147 return len;
@@ -217,7 +217,7 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)
217 if (!capable(CAP_SYS_ADMIN)) 217 if (!capable(CAP_SYS_ADMIN))
218 return -EPERM; 218 return -EPERM;
219 err = 219 err =
220 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, 220 mtrr_file_add(sentry.base, sentry.size, sentry.type, true,
221 file, 0); 221 file, 0);
222 break; 222 break;
223 case MTRRIOC_SET_ENTRY: 223 case MTRRIOC_SET_ENTRY:
@@ -226,7 +226,7 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)
226#endif 226#endif
227 if (!capable(CAP_SYS_ADMIN)) 227 if (!capable(CAP_SYS_ADMIN))
228 return -EPERM; 228 return -EPERM;
229 err = mtrr_add(sentry.base, sentry.size, sentry.type, 0); 229 err = mtrr_add(sentry.base, sentry.size, sentry.type, false);
230 break; 230 break;
231 case MTRRIOC_DEL_ENTRY: 231 case MTRRIOC_DEL_ENTRY:
232#ifdef CONFIG_COMPAT 232#ifdef CONFIG_COMPAT
@@ -270,7 +270,7 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)
270 if (!capable(CAP_SYS_ADMIN)) 270 if (!capable(CAP_SYS_ADMIN))
271 return -EPERM; 271 return -EPERM;
272 err = 272 err =
273 mtrr_file_add(sentry.base, sentry.size, sentry.type, 1, 273 mtrr_file_add(sentry.base, sentry.size, sentry.type, true,
274 file, 1); 274 file, 1);
275 break; 275 break;
276 case MTRRIOC_SET_PAGE_ENTRY: 276 case MTRRIOC_SET_PAGE_ENTRY:
@@ -279,7 +279,8 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)
279#endif 279#endif
280 if (!capable(CAP_SYS_ADMIN)) 280 if (!capable(CAP_SYS_ADMIN))
281 return -EPERM; 281 return -EPERM;
282 err = mtrr_add_page(sentry.base, sentry.size, sentry.type, 0); 282 err =
283 mtrr_add_page(sentry.base, sentry.size, sentry.type, false);
283 break; 284 break;
284 case MTRRIOC_DEL_PAGE_ENTRY: 285 case MTRRIOC_DEL_PAGE_ENTRY:
285#ifdef CONFIG_COMPAT 286#ifdef CONFIG_COMPAT