Skip to contentSkip to conversation

kernel/smp: Use smp_call_func_t in on_each_cpu()

PATCH RESEND Applied Kaitao Cheng 3 participants 4 messages Apr 17, 2020 – Apr 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 kernel/smp: Use smp_call_func_t in on_each_cpu()

There is already a typedef smp_call_func_t, so we can just use it, maybe better.

Fixes 3a5f65df5a0fc ("Typedef SMP call function pointer")
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +1 -1
index 786092aabdcd..84303197caf9 100644
@@ -620,7 +620,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(void (*func) (void *info), void *info, int wait)
+void on_each_cpu(smp_call_func_t func, void *info, int wait)
 {
 	unsigned long flags;
 
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Kaitao Cheng

There is already a typedef smp_call_func_t, so we can just use it, maybe better.

Fixes 3a5f65df5a0fc ("Typedef SMP call function pointer")

I would not go as far as the Fixes: tag but otherwise:

Quoted 9 lines
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +0 -0
index 786092aabdcd..84303197caf9 100644

kernel/smp.c void __init smp_init(void) · line 626

Quoted 8 lines
kernel/smp.c +1 -1
@@ -620,7 +620,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(void (*func) (void *info), void *info, int wait)
+void on_each_cpu(smp_call_func_t func, void *info, int wait)
 {
 	unsigned long flags;
 

Sebastian

#2 lore raw
Quoted 11 lines · Sebastian Andrzej Siewior
Quoted 5 lines · Kaitao Cheng

There is already a typedef smp_call_func_t, so we can just use it, maybe better.

Fixes 3a5f65df5a0fc ("Typedef SMP call function pointer")

I would not go as far as the Fixes: tag but otherwise:

Thanks for your review. Do you mean I should delete the Fixes tag?

Quoted 20 lines
Quoted 10 lines
---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +0 -0
index 786092aabdcd..84303197caf9 100644

kernel/smp.c void __init smp_init(void) · line 626

Quoted 8 lines
kernel/smp.c +1 -1
@@ -620,7 +620,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(void (*func) (void *info), void *info, int wait)
+void on_each_cpu(smp_call_func_t func, void *info, int wait)
 {
      unsigned long flags;
 

Sebastian

merge bot Applied
#3 lore raw

[tip: smp/core] smp: Use smp_call_func_t in on_each_cpu()

In reply to Kaitao Cheng
The following commit has been merged into the smp/core branch of tip:

The following commit has been merged into the smp/core branch of tip:

Commit-ID:     58eb7b77ad01f058e523554cb7bae7272a7d2579
Gitweb:        https://git.kernel.org/tip/58eb7b77ad01f058e523554cb7bae7272a7d2579
Author:        Kaitao Cheng <[email protected]>
AuthorDate:    Sat, 18 Apr 2020 00:24:51 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 19 Apr 2020 17:51:48 +02:00

smp: Use smp_call_func_t in on_each_cpu()

Use smp_call_func_t instead of the open coded function pointer argument.

---
 kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/smp.c +1 -1
index 786092a..8430319 100644
@@ -620,7 +620,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(void (*func) (void *info), void *info, int wait)
+void on_each_cpu(smp_call_func_t func, void *info, int wait)
 {
 	unsigned long flags;