diff mbox series

[RFC,2/9] irq_work: add irq_work_queue_on for !CONFIG_SMP

Message ID 85403db254e26655d608137d7df49ebf3aade0c3.1489058244.git.viresh.kumar@linaro.org
State New
Headers show
Series cpufreq: schedutil: Allow remote wakeups | expand

Commit Message

Viresh Kumar March 9, 2017, 11:45 a.m. UTC
From: Steve Muckle <smuckle.linux@gmail.com>


Having irq_work_queue_on() available for !CONFIG_SMP can make some
call sites cleaner.

Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
 include/linux/irq_work.h | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.7.1.410.g6faf27b

Comments

Rafael J. Wysocki March 29, 2017, 9:20 p.m. UTC | #1
On Thursday, March 09, 2017 05:15:12 PM Viresh Kumar wrote:
> From: Steve Muckle <smuckle.linux@gmail.com>

> 

> Having irq_work_queue_on() available for !CONFIG_SMP can make some

> call sites cleaner.

> 

> Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>

> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

> ---

>  include/linux/irq_work.h | 7 +++++++

>  1 file changed, 7 insertions(+)

> 

> diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h

> index 47b9ebd4a74f..0195c3502d6b 100644

> --- a/include/linux/irq_work.h

> +++ b/include/linux/irq_work.h

> @@ -1,6 +1,7 @@

>  #ifndef _LINUX_IRQ_WORK_H

>  #define _LINUX_IRQ_WORK_H

>  

> +#include <linux/bug.h>

>  #include <linux/llist.h>

>  

>  /*

> @@ -36,6 +37,12 @@ bool irq_work_queue(struct irq_work *work);

>  

>  #ifdef CONFIG_SMP

>  bool irq_work_queue_on(struct irq_work *work, int cpu);

> +#else

> +static inline bool irq_work_queue_on(struct irq_work *work, int cpu)

> +{

> +	BUG_ON(cpu != 0);


Would WARN_ON(), or WARN_ON_ONCE() even, be insufficient?

> +	return irq_work_queue(work);

> +}

>  #endif

>  

>  void irq_work_tick(void);

> 


Thanks,
Rafael
diff mbox series

Patch

diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 47b9ebd4a74f..0195c3502d6b 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -1,6 +1,7 @@ 
 #ifndef _LINUX_IRQ_WORK_H
 #define _LINUX_IRQ_WORK_H
 
+#include <linux/bug.h>
 #include <linux/llist.h>
 
 /*
@@ -36,6 +37,12 @@  bool irq_work_queue(struct irq_work *work);
 
 #ifdef CONFIG_SMP
 bool irq_work_queue_on(struct irq_work *work, int cpu);
+#else
+static inline bool irq_work_queue_on(struct irq_work *work, int cpu)
+{
+	BUG_ON(cpu != 0);
+	return irq_work_queue(work);
+}
 #endif
 
 void irq_work_tick(void);