[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20071022.235458.111209400.anemo@mba.ocn.ne.jp>
Date: Mon, 22 Oct 2007 23:54:58 +0900 (JST)
From: Atsushi Nemoto <anemo@....ocn.ne.jp>
To: linux-kernel@...r.kernel.org
Cc: John Stultz <johnstul@...ibm.com>, akpm@...ux-foundation.org
Subject: [PATCH] clocksource: Make CLOCKSOURCE_MASK bullet-proof
Signed-off-by: Atsushi Nemoto <anemo@....ocn.ne.jp>
---
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 107787a..07b4215 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -103,7 +103,7 @@ struct clocksource {
#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
/* simplify initialization of mask field */
-#define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1)
+#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
/**
* clocksource_khz2mult - calculates mult from khz and shift
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists