diff mbox

[1/5] timer: move enum definition out of ifdef section

Message ID 1364379733-23725-1-git-send-email-daniel.lezcano@linaro.org
State New
Headers show

Commit Message

Daniel Lezcano March 27, 2013, 10:22 a.m. UTC
The next patch will setup automatically the broadcast timer for
the different cpuidle driver when one idle state stops its timer.
This will be part of the generic code.

But some ARM boards, like s3c64xx, uses cpuidle but without the
CONFIG_GENERIC_CLOCKEVENTS_BUILD set. Hence the cpuidle framework
will be compiled with the code supposed to be generic, that is
with clockevents_notify and the different enum.

Also the function clockevents_notify is a noop macro, this is fine
except the usual code is:

	int cpu = smp_processor_id();
	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);

and that raises a warning for the variable cpu which is not used.

Move the clock_event_nofitiers enum definition out of the
CONFIG_GENERIC_CLOCKEVENTS_BUILD section to prevent a compilation
error when these are used in the code.

Change the clockevents_notify macro to a static inline noop function
to prevent a compilation warning.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/clockchips.h |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

Comments

Rafael J. Wysocki April 1, 2013, 11:24 p.m. UTC | #1
Hi,

All 5 in this series applied to linux-pm.git/linux-next.

What am I supposed to do with patches [6-15/15] in your previous series?

Are you going to resend the ones that have been ACKed?

Rafael


On Wednesday, March 27, 2013 11:22:09 AM Daniel Lezcano wrote:
> The next patch will setup automatically the broadcast timer for
> the different cpuidle driver when one idle state stops its timer.
> This will be part of the generic code.
> 
> But some ARM boards, like s3c64xx, uses cpuidle but without the
> CONFIG_GENERIC_CLOCKEVENTS_BUILD set. Hence the cpuidle framework
> will be compiled with the code supposed to be generic, that is
> with clockevents_notify and the different enum.
> 
> Also the function clockevents_notify is a noop macro, this is fine
> except the usual code is:
> 
> 	int cpu = smp_processor_id();
> 	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
> 
> and that raises a warning for the variable cpu which is not used.
> 
> Move the clock_event_nofitiers enum definition out of the
> CONFIG_GENERIC_CLOCKEVENTS_BUILD section to prevent a compilation
> error when these are used in the code.
> 
> Change the clockevents_notify macro to a static inline noop function
> to prevent a compilation warning.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>  include/linux/clockchips.h |   32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
> index 6634652..f9fd937 100644
> --- a/include/linux/clockchips.h
> +++ b/include/linux/clockchips.h
> @@ -8,6 +8,20 @@
>  #ifndef _LINUX_CLOCKCHIPS_H
>  #define _LINUX_CLOCKCHIPS_H
>  
> +/* Clock event notification values */
> +enum clock_event_nofitiers {
> +	CLOCK_EVT_NOTIFY_ADD,
> +	CLOCK_EVT_NOTIFY_BROADCAST_ON,
> +	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
> +	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
> +	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
> +	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
> +	CLOCK_EVT_NOTIFY_SUSPEND,
> +	CLOCK_EVT_NOTIFY_RESUME,
> +	CLOCK_EVT_NOTIFY_CPU_DYING,
> +	CLOCK_EVT_NOTIFY_CPU_DEAD,
> +};
> +
>  #ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
>  
>  #include <linux/clocksource.h>
> @@ -26,20 +40,6 @@ enum clock_event_mode {
>  	CLOCK_EVT_MODE_RESUME,
>  };
>  
> -/* Clock event notification values */
> -enum clock_event_nofitiers {
> -	CLOCK_EVT_NOTIFY_ADD,
> -	CLOCK_EVT_NOTIFY_BROADCAST_ON,
> -	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
> -	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
> -	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
> -	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
> -	CLOCK_EVT_NOTIFY_SUSPEND,
> -	CLOCK_EVT_NOTIFY_RESUME,
> -	CLOCK_EVT_NOTIFY_CPU_DYING,
> -	CLOCK_EVT_NOTIFY_CPU_DEAD,
> -};
> -
>  /*
>   * Clock event features
>   */
> @@ -173,7 +173,7 @@ extern int tick_receive_broadcast(void);
>  #ifdef CONFIG_GENERIC_CLOCKEVENTS
>  extern void clockevents_notify(unsigned long reason, void *arg);
>  #else
> -# define clockevents_notify(reason, arg) do { } while (0)
> +static inline void clockevents_notify(unsigned long reason, void *arg) {}
>  #endif
>  
>  #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
> @@ -181,7 +181,7 @@ extern void clockevents_notify(unsigned long reason, void *arg);
>  static inline void clockevents_suspend(void) {}
>  static inline void clockevents_resume(void) {}
>  
> -#define clockevents_notify(reason, arg) do { } while (0)
> +static inline void clockevents_notify(unsigned long reason, void *arg) {}
>  
>  #endif
>  
>
Daniel Lezcano April 2, 2013, 4:43 a.m. UTC | #2
On 04/02/2013 01:24 AM, Rafael J. Wysocki wrote:
> Hi,
> 
> All 5 in this series applied to linux-pm.git/linux-next.
> 
> What am I supposed to do with patches [6-15/15] in your previous series?
> 
> Are you going to resend the ones that have been ACKed?

No, please ignore them. After discussing, people want to see the init
function in the cpuidle framework not in a generic ARM driver. So I am
rewriting the patchset for that.

There are the cleanups before to apply [1], except [4/9] which was
already fixed in the OMAP tree.

Thanks
  -- Daniel

[1] https://patchwork.kernel.org/patch/2365041/

> On Wednesday, March 27, 2013 11:22:09 AM Daniel Lezcano wrote:
>> The next patch will setup automatically the broadcast timer for
>> the different cpuidle driver when one idle state stops its timer.
>> This will be part of the generic code.
>>
>> But some ARM boards, like s3c64xx, uses cpuidle but without the
>> CONFIG_GENERIC_CLOCKEVENTS_BUILD set. Hence the cpuidle framework
>> will be compiled with the code supposed to be generic, that is
>> with clockevents_notify and the different enum.
>>
>> Also the function clockevents_notify is a noop macro, this is fine
>> except the usual code is:
>>
>> 	int cpu = smp_processor_id();
>> 	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
>>
>> and that raises a warning for the variable cpu which is not used.
>>
>> Move the clock_event_nofitiers enum definition out of the
>> CONFIG_GENERIC_CLOCKEVENTS_BUILD section to prevent a compilation
>> error when these are used in the code.
>>
>> Change the clockevents_notify macro to a static inline noop function
>> to prevent a compilation warning.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> ---
>>  include/linux/clockchips.h |   32 ++++++++++++++++----------------
>>  1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
>> index 6634652..f9fd937 100644
>> --- a/include/linux/clockchips.h
>> +++ b/include/linux/clockchips.h
>> @@ -8,6 +8,20 @@
>>  #ifndef _LINUX_CLOCKCHIPS_H
>>  #define _LINUX_CLOCKCHIPS_H
>>  
>> +/* Clock event notification values */
>> +enum clock_event_nofitiers {
>> +	CLOCK_EVT_NOTIFY_ADD,
>> +	CLOCK_EVT_NOTIFY_BROADCAST_ON,
>> +	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
>> +	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
>> +	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
>> +	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
>> +	CLOCK_EVT_NOTIFY_SUSPEND,
>> +	CLOCK_EVT_NOTIFY_RESUME,
>> +	CLOCK_EVT_NOTIFY_CPU_DYING,
>> +	CLOCK_EVT_NOTIFY_CPU_DEAD,
>> +};
>> +
>>  #ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
>>  
>>  #include <linux/clocksource.h>
>> @@ -26,20 +40,6 @@ enum clock_event_mode {
>>  	CLOCK_EVT_MODE_RESUME,
>>  };
>>  
>> -/* Clock event notification values */
>> -enum clock_event_nofitiers {
>> -	CLOCK_EVT_NOTIFY_ADD,
>> -	CLOCK_EVT_NOTIFY_BROADCAST_ON,
>> -	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
>> -	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
>> -	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
>> -	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
>> -	CLOCK_EVT_NOTIFY_SUSPEND,
>> -	CLOCK_EVT_NOTIFY_RESUME,
>> -	CLOCK_EVT_NOTIFY_CPU_DYING,
>> -	CLOCK_EVT_NOTIFY_CPU_DEAD,
>> -};
>> -
>>  /*
>>   * Clock event features
>>   */
>> @@ -173,7 +173,7 @@ extern int tick_receive_broadcast(void);
>>  #ifdef CONFIG_GENERIC_CLOCKEVENTS
>>  extern void clockevents_notify(unsigned long reason, void *arg);
>>  #else
>> -# define clockevents_notify(reason, arg) do { } while (0)
>> +static inline void clockevents_notify(unsigned long reason, void *arg) {}
>>  #endif
>>  
>>  #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
>> @@ -181,7 +181,7 @@ extern void clockevents_notify(unsigned long reason, void *arg);
>>  static inline void clockevents_suspend(void) {}
>>  static inline void clockevents_resume(void) {}
>>  
>> -#define clockevents_notify(reason, arg) do { } while (0)
>> +static inline void clockevents_notify(unsigned long reason, void *arg) {}
>>  
>>  #endif
>>  
>>
Rafael J. Wysocki April 2, 2013, 1:27 p.m. UTC | #3
On Tuesday, April 02, 2013 06:43:38 AM Daniel Lezcano wrote:
> On 04/02/2013 01:24 AM, Rafael J. Wysocki wrote:
> > Hi,
> > 
> > All 5 in this series applied to linux-pm.git/linux-next.
> > 
> > What am I supposed to do with patches [6-15/15] in your previous series?
> > 
> > Are you going to resend the ones that have been ACKed?
> 
> No, please ignore them. After discussing, people want to see the init
> function in the cpuidle framework not in a generic ARM driver. So I am
> rewriting the patchset for that.
> 
> There are the cleanups before to apply [1], except [4/9] which was
> already fixed in the OMAP tree.

OK, I'll ignore the rest of that patchset, then.

Thanks,
Rafael
diff mbox

Patch

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 6634652..f9fd937 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -8,6 +8,20 @@ 
 #ifndef _LINUX_CLOCKCHIPS_H
 #define _LINUX_CLOCKCHIPS_H
 
+/* Clock event notification values */
+enum clock_event_nofitiers {
+	CLOCK_EVT_NOTIFY_ADD,
+	CLOCK_EVT_NOTIFY_BROADCAST_ON,
+	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
+	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
+	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
+	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
+	CLOCK_EVT_NOTIFY_SUSPEND,
+	CLOCK_EVT_NOTIFY_RESUME,
+	CLOCK_EVT_NOTIFY_CPU_DYING,
+	CLOCK_EVT_NOTIFY_CPU_DEAD,
+};
+
 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
 
 #include <linux/clocksource.h>
@@ -26,20 +40,6 @@  enum clock_event_mode {
 	CLOCK_EVT_MODE_RESUME,
 };
 
-/* Clock event notification values */
-enum clock_event_nofitiers {
-	CLOCK_EVT_NOTIFY_ADD,
-	CLOCK_EVT_NOTIFY_BROADCAST_ON,
-	CLOCK_EVT_NOTIFY_BROADCAST_OFF,
-	CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
-	CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
-	CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
-	CLOCK_EVT_NOTIFY_SUSPEND,
-	CLOCK_EVT_NOTIFY_RESUME,
-	CLOCK_EVT_NOTIFY_CPU_DYING,
-	CLOCK_EVT_NOTIFY_CPU_DEAD,
-};
-
 /*
  * Clock event features
  */
@@ -173,7 +173,7 @@  extern int tick_receive_broadcast(void);
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 extern void clockevents_notify(unsigned long reason, void *arg);
 #else
-# define clockevents_notify(reason, arg) do { } while (0)
+static inline void clockevents_notify(unsigned long reason, void *arg) {}
 #endif
 
 #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
@@ -181,7 +181,7 @@  extern void clockevents_notify(unsigned long reason, void *arg);
 static inline void clockevents_suspend(void) {}
 static inline void clockevents_resume(void) {}
 
-#define clockevents_notify(reason, arg) do { } while (0)
+static inline void clockevents_notify(unsigned long reason, void *arg) {}
 
 #endif