mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: slightly simplify print_mtrr_state()
@ 2012-07-06 14:20 Jan Beulich
  2012-07-10  9:56 ` [tip:x86/asm] x86/mm/mtrr: Slightly " tip-bot for Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2012-07-06 14:20 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 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))




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

end of thread, other threads:[~2012-07-10  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 14:20 [PATCH] x86: slightly simplify print_mtrr_state() Jan Beulich
2012-07-10  9:56 ` [tip:x86/asm] x86/mm/mtrr: Slightly " tip-bot for Jan Beulich

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

Powered by JetHome