public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yejune Deng <yejune.deng@gmail.com>
To: peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org,
	frederic@kernel.org, bigeasy@linutronix.de, qais.yousef@arm.com,
	paulmck@kernel.org
Cc: linux-kernel@vger.kernel.org, Yejune Deng <yejune.deng@gmail.com>
Subject: [PATCH] smp: Modify 'int' to 'bool' in smp_call_function_single()
Date: Tue, 19 Jan 2021 22:13:50 +0800	[thread overview]
Message-ID: <20210119141350.80522-1-yejune.deng@gmail.com> (raw)

In smp_call_function_single() and its caller,the 'wait' variable is only
0 and 1,a bool is a more appropriate definition.

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
 include/linux/smp.h | 10 +++++-----
 kernel/smp.c        |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 70c6f6284dcf..5f27ebd504e2 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -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);
 }
diff --git a/kernel/smp.c b/kernel/smp.c
index 1b6070bf97bb..c72e474d53ab 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -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;
 
-- 
2.29.0


             reply	other threads:[~2021-01-19 18:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 14:13 Yejune Deng [this message]
2021-01-20 11:43 ` [PATCH] smp: Modify 'int' to 'bool' in smp_call_function_single() kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210119141350.80522-1-yejune.deng@gmail.com \
    --to=yejune.deng@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qais.yousef@arm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox