summaryrefslogtreecommitdiffstats
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2006-06-26 00:25:15 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 09:58:21 -0700
commit7f9f303aa33c7acc7b4aa9ebea25cbd990bc707b (patch)
treeb5916e6b018356afdb5c8687e554a049532633bd /include/linux/clocksource.h
parent7d622d4794490cef933c20e4a6279e43e03fafad (diff)
downloadlinux-7f9f303aa33c7acc7b4aa9ebea25cbd990bc707b.tar.gz
linux-7f9f303aa33c7acc7b4aa9ebea25cbd990bc707b.tar.bz2
linux-7f9f303aa33c7acc7b4aa9ebea25cbd990bc707b.zip
[PATCH] generic-time: add macro to simplify/hide mask constants
Add a CLOCKSOURCE_MASK macro to simplify initializing the mask for a struct clocksource, and use it to replace literal mask constants in the various clocksource drivers. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Acked-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 5f4a7f72f3ee..4bc94282c364 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -65,6 +65,8 @@ struct clocksource {
u64 interval_snsecs;
};
+/* simplify initialization of mask field */
+#define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1)
/**
* clocksource_khz2mult - calculates mult from khz and shift