* [PATCH] clockchips: convert the code format to BIT()
@ 2019-01-16 16:09 Yangtao Li
2019-01-16 16:49 ` Randy Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2019-01-16 16:09 UTC (permalink / raw)
To: tglx, linux-kernel; +Cc: Yangtao Li
Use BIT() to do some clean-up.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
include/linux/clockchips.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8ae9a95ebf5b..39a2294e995b 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -43,9 +43,9 @@ enum clock_event_state {
/*
* Clock event features
*/
-# define CLOCK_EVT_FEAT_PERIODIC 0x000001
-# define CLOCK_EVT_FEAT_ONESHOT 0x000002
-# define CLOCK_EVT_FEAT_KTIME 0x000004
+# define CLOCK_EVT_FEAT_PERIODIC BIT(0)
+# define CLOCK_EVT_FEAT_ONESHOT BIT(1)
+# define CLOCK_EVT_FEAT_KTIME BIT(2)
/*
* x86(64) specific (mis)features:
@@ -53,19 +53,19 @@ enum clock_event_state {
* - Clockevent source stops in C3 State and needs broadcast support.
* - Local APIC timer is used as a dummy device.
*/
-# define CLOCK_EVT_FEAT_C3STOP 0x000008
-# define CLOCK_EVT_FEAT_DUMMY 0x000010
+# define CLOCK_EVT_FEAT_C3STOP BIT(3)
+# define CLOCK_EVT_FEAT_DUMMY BIT(4)
/*
* Core shall set the interrupt affinity dynamically in broadcast mode
*/
-# define CLOCK_EVT_FEAT_DYNIRQ 0x000020
-# define CLOCK_EVT_FEAT_PERCPU 0x000040
+# define CLOCK_EVT_FEAT_DYNIRQ BIT(5)
+# define CLOCK_EVT_FEAT_PERCPU BIT(6)
/*
* Clockevent device is based on a hrtimer for broadcast
*/
-# define CLOCK_EVT_FEAT_HRTIMER 0x000080
+# define CLOCK_EVT_FEAT_HRTIMER BIT(7)
/**
* struct clock_event_device - clock event device descriptor
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clockchips: convert the code format to BIT()
2019-01-16 16:09 [PATCH] clockchips: convert the code format to BIT() Yangtao Li
@ 2019-01-16 16:49 ` Randy Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2019-01-16 16:49 UTC (permalink / raw)
To: Yangtao Li, tglx, linux-kernel
On 1/16/19 8:09 AM, Yangtao Li wrote:
> Use BIT() to do some clean-up.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Hi,
Looks to me like this header file needs to
#include <linux/bitops.h>
and not assume that the bitops.h header file will be pulled in
by some side effect.
> ---
> include/linux/clockchips.h | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
> index 8ae9a95ebf5b..39a2294e995b 100644
> --- a/include/linux/clockchips.h
> +++ b/include/linux/clockchips.h
> @@ -43,9 +43,9 @@ enum clock_event_state {
> /*
> * Clock event features
> */
> -# define CLOCK_EVT_FEAT_PERIODIC 0x000001
> -# define CLOCK_EVT_FEAT_ONESHOT 0x000002
> -# define CLOCK_EVT_FEAT_KTIME 0x000004
> +# define CLOCK_EVT_FEAT_PERIODIC BIT(0)
> +# define CLOCK_EVT_FEAT_ONESHOT BIT(1)
> +# define CLOCK_EVT_FEAT_KTIME BIT(2)
>
> /*
> * x86(64) specific (mis)features:
> @@ -53,19 +53,19 @@ enum clock_event_state {
> * - Clockevent source stops in C3 State and needs broadcast support.
> * - Local APIC timer is used as a dummy device.
> */
> -# define CLOCK_EVT_FEAT_C3STOP 0x000008
> -# define CLOCK_EVT_FEAT_DUMMY 0x000010
> +# define CLOCK_EVT_FEAT_C3STOP BIT(3)
> +# define CLOCK_EVT_FEAT_DUMMY BIT(4)
>
> /*
> * Core shall set the interrupt affinity dynamically in broadcast mode
> */
> -# define CLOCK_EVT_FEAT_DYNIRQ 0x000020
> -# define CLOCK_EVT_FEAT_PERCPU 0x000040
> +# define CLOCK_EVT_FEAT_DYNIRQ BIT(5)
> +# define CLOCK_EVT_FEAT_PERCPU BIT(6)
>
> /*
> * Clockevent device is based on a hrtimer for broadcast
> */
> -# define CLOCK_EVT_FEAT_HRTIMER 0x000080
> +# define CLOCK_EVT_FEAT_HRTIMER BIT(7)
>
> /**
> * struct clock_event_device - clock event device descriptor
>
ciao.
--
~Randy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-16 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 16:09 [PATCH] clockchips: convert the code format to BIT() Yangtao Li
2019-01-16 16:49 ` Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.