smp/up: Modify the 'wait' variable from 'int' to 'bool'
PATCH 1/1 smp/up: Modify the 'wait' variable from 'int' to 'bool'
In smp_call_function_single() and its caller,the 'wait' variable is only 0 and 1,a bool is a more appropriate definition.
Fix kernel/up.c: when CONFIG_SMP is not set
Quoted 1 line
Quoted 1 line
kernel/up.c:12:5: error: conflicting types for 'smp_call_function_single'
12 | int smp_call_function_single(int cpu, void (*func) (void *info),
void *info,
Quoted 1 line
Quoted 1 line
kernel/up.c:39:6: error: conflicting types for 'on_each_cpu'
39 | void on_each_cpu(smp_call_func_t func, void *info, int wait)
Reported-by kernel test robot <[email protected]>
Signed-off-by Yejune Deng <[email protected]>
--- include/linux/smp.h | 10 +++++----- kernel/smp.c | 8 ++++---- kernel/up.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-)
include/linux/smp.h +5 -5
@@ -48,12 +48,12 @@ extern void __smp_call_single_queue(int cpu, struct llist_node *node);extern unsigned int total_cpus;int smp_call_function_single (int cpuid,smp_call_func_t func,void *info, -int wait); +bool wait);/* * Call a function on all processors */ -void on_each_cpu (smp_call_func_t func,void *info,int wait); +void on_each_cpu (smp_call_func_t func,void *info,bool wait);/* * Call a function on processors specified by mask, which might include
@@ -117,12 +117,12 @@ extern void smp_cpus_done(unsigned int max_cpus);/* * Call a function on all other processors */ -void smp_call_function (smp_call_func_t func,void *info,int wait); +void smp_call_function (smp_call_func_t func,void *info,bool wait);void smp_call_function_many (const struct cpumask *mask,smp_call_func_t func,void *info,bool wait);int smp_call_function_any (const struct cpumask *mask, -smp_call_func_t func,void *info,int wait); +smp_call_func_t func,void *info,bool wait);void kick_all_cpus_sync (void );void wake_up_all_idle_cpus (void );
@@ -174,7 +174,7 @@ static inline void call_function_init(void) { }static inline int smp_call_function_any (const struct cpumask *mask,smp_call_func_t func, -void *info,int wait) +void *info,bool wait) {return smp_call_function_single (0 , func, info, wait); }
kernel/smp.c +4 -4
@@ -461,7 +461,7 @@ void flush_smp_call_function_from_idle(void)* Returns 0 on success, else a negative status code. */ int smp_call_function_single (int cpu,smp_call_func_t func,void *info, -int wait) +bool wait) {call_single_data_t *csd;call_single_data_t csd_stack = {
@@ -576,7 +576,7 @@ EXPORT_SYMBOL_GPL(smp_call_function_single_async);* 3) any other online cpu in @mask */ int smp_call_function_any (const struct cpumask *mask, -smp_call_func_t func,void *info,int wait) +smp_call_func_t func,void *info,bool wait) {unsigned int cpu;const struct cpumask *nodemask;
@@ -727,7 +727,7 @@ EXPORT_SYMBOL(smp_call_function_many);* You must not call this function with disabled interrupts or from a * hardware interrupt handler or from a bottom half handler. */ -void smp_call_function (smp_call_func_t func,void *info,int wait) +void smp_call_function (smp_call_func_t func,void *info,bool wait) {preempt_disable ();smp_call_function_many (cpu_online_mask, func, info, wait);
@@ -824,7 +824,7 @@ void __init smp_init(void)* early_boot_irqs_disabled is set. Use local_irq_save/restore() instead * of local_irq_disable/enable(). */ -void on_each_cpu (smp_call_func_t func,void *info,int wait) +void on_each_cpu (smp_call_func_t func,void *info,bool wait) {unsigned long flags;
kernel/up.c +3 -3
@@ -9,8 +9,8 @@#include <linux/smp.h> #include <linux/hypervisor.h> -int smp_call_function_single (int cpu,void (*func) (void *info),void *info, -int wait) +int smp_call_function_single (int cpu,void (*func) (void *info), +void *info,bool wait) {unsigned long flags;
@@ -36,7 +36,7 @@ int smp_call_function_single_async(int cpu, call_single_data_t *csd) }EXPORT_SYMBOL (smp_call_function_single_async); -void on_each_cpu (smp_call_func_t func,void *info,int wait) +void on_each_cpu (smp_call_func_t func,void *info,bool wait) {unsigned long flags;
Signature · 1 line
2.29.0