diff options
author | Paul Jimenez <pj@place.org> | 2008-01-30 07:30:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:31 -0500 |
commit | 2d2ee8de5f6d26ef2942e0b449aa68d9236d5777 (patch) | |
tree | 09589fa4f7386b9bc2c0ac07aa5a272396286d35 /arch/x86/kernel/cpu/mtrr/main.c | |
parent | 3e7593966be6f6d29a15138c0c96b961d437f2f5 (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/main.c')
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index beb45c9c083..60af5ed2b5c 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -311,7 +311,7 @@ static void set_mtrr(unsigned int reg, unsigned long base, | |||
311 | */ | 311 | */ |
312 | 312 | ||
313 | int mtrr_add_page(unsigned long base, unsigned long size, | 313 | int mtrr_add_page(unsigned long base, unsigned long size, |
314 | unsigned int type, char increment) | 314 | unsigned int type, bool increment) |
315 | { | 315 | { |
316 | int i, replace, error; | 316 | int i, replace, error; |
317 | mtrr_type ltype; | 317 | mtrr_type ltype; |
@@ -394,7 +394,9 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
394 | if (likely(replace < 0)) | 394 | if (likely(replace < 0)) |
395 | usage_table[i] = 1; | 395 | usage_table[i] = 1; |
396 | else { | 396 | else { |
397 | usage_table[i] = usage_table[replace] + !!increment; | 397 | usage_table[i] = usage_table[replace]; |
398 | if (increment) | ||
399 | usage_table[i]++; | ||
398 | if (unlikely(replace != i)) { | 400 | if (unlikely(replace != i)) { |
399 | set_mtrr(replace, 0, 0, 0); | 401 | set_mtrr(replace, 0, 0, 0); |
400 | usage_table[replace] = 0; | 402 | usage_table[replace] = 0; |
@@ -460,7 +462,7 @@ static int mtrr_check(unsigned long base, unsigned long size) | |||
460 | 462 | ||
461 | int | 463 | int |
462 | mtrr_add(unsigned long base, unsigned long size, unsigned int type, | 464 | mtrr_add(unsigned long base, unsigned long size, unsigned int type, |
463 | char increment) | 465 | bool increment) |
464 | { | 466 | { |
465 | if (mtrr_check(base, size)) | 467 | if (mtrr_check(base, size)) |
466 | return -EINVAL; | 468 | return -EINVAL; |