[PATCH] x86: slightly simplify print_mtrr_state()

From: Jan Beulich
Date: Fri Jul 06 2012 - 10:19:36 EST


high_width can be easily calculated in a single expression when making
use of __ffs64().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

---
arch/x86/kernel/cpu/mtrr/generic.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

--- 3.5-rc5/arch/x86/kernel/cpu/mtrr/generic.c
+++ 3.5-rc5-x86-mtrr-print-simplify/arch/x86/kernel/cpu/mtrr/generic.c
@@ -361,11 +361,7 @@ static void __init print_mtrr_state(void
}
pr_debug("MTRR variable ranges %sabled:\n",
mtrr_state.enabled & 2 ? "en" : "dis");
- if (size_or_mask & 0xffffffffUL)
- high_width = ffs(size_or_mask & 0xffffffffUL) - 1;
- else
- high_width = ffs(size_or_mask>>32) + 32 - 1;
- high_width = (high_width - (32 - PAGE_SHIFT) + 3) / 4;
+ high_width = (__ffs64(size_or_mask) - (32 - PAGE_SHIFT) + 3) / 4;

for (i = 0; i < num_var_ranges; ++i) {
if (mtrr_state.var_ranges[i].mask_lo & (1 << 11))



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/