]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
clocksource: make CLOCKSOURCE_MASK bullet-proof
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Wed, 30 Jan 2008 12:30:01 +0000 (13:30 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:30:01 +0000 (13:30 +0100)
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/clocksource.h

index 107787aacb647c95c37f53bf94d2660486d687a3..07b42153de245b711e81467fad632aeec0feb486 100644 (file)
@@ -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