[PRE-REVIEW,16/16] tasklet: Add the new initialization function permanently
diff mbox series

Message ID 20190929163028.9665-17-romain.perier@gmail.com
State New
Headers show
Series
  • Modernize the tasklet API
Related show

Commit Message

Romain Perier Sept. 29, 2019, 4:30 p.m. UTC
Now that everything has been converted to the new API, we can remove
tasklet_init() and replace it by tasklet_setup().

Signed-off-by: Romain Perier <romain.perier@gmail.com>
---
 include/linux/interrupt.h | 9 +--------
 kernel/softirq.c          | 4 ++--
 2 files changed, 3 insertions(+), 10 deletions(-)

Comments

Kees Cook Sept. 30, 2019, 10:52 p.m. UTC | #1
On Sun, Sep 29, 2019 at 06:30:28PM +0200, Romain Perier wrote:
> Now that everything has been converted to the new API, we can remove
> tasklet_init() and replace it by tasklet_setup().
> 
> Signed-off-by: Romain Perier <romain.perier@gmail.com>

If this is the last user of TASKLET_*_TYPE casts, those should get
dropped here too.

-Kees

> ---
>  include/linux/interrupt.h | 9 +--------
>  kernel/softirq.c          | 4 ++--
>  2 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index 506300396db9..0e8f6bca45a4 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -672,18 +672,11 @@ static inline void tasklet_enable(struct tasklet_struct *t)
>  
>  extern void tasklet_kill(struct tasklet_struct *t);
>  extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
> -extern void tasklet_init(struct tasklet_struct *t,
> +extern void tasklet_setup(struct tasklet_struct *t,
>  			 void (*func)(struct tasklet_struct *));
>  
>  #define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
>  	container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
> -
> -static inline void tasklet_setup(struct tasklet_struct *t,
> -				 void (*callback)(struct tasklet_struct *))
> -{
> -	tasklet_init(t, (TASKLET_FUNC_TYPE)callback);
> -}
> -
>  /*
>   * Autoprobing for irqs:
>   *
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index 7415a7c4b494..179dce78fff8 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -546,7 +546,7 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
>  	tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
>  }
>  
> -void tasklet_init(struct tasklet_struct *t,
> +void tasklet_setup(struct tasklet_struct *t,
>  		  void (*func)(struct tasklet_struct *))
>  {
>  	t->next = NULL;
> @@ -554,7 +554,7 @@ void tasklet_init(struct tasklet_struct *t,
>  	atomic_set(&t->count, 0);
>  	t->func = func;
>  }
> -EXPORT_SYMBOL(tasklet_init);
> +EXPORT_SYMBOL(tasklet_setup);
>  
>  void tasklet_kill(struct tasklet_struct *t)
>  {
> -- 
> 2.23.0
>
Romain Perier Oct. 1, 2019, 5:34 p.m. UTC | #2
On Mon, Sep 30, 2019 at 03:52:19PM -0700, Kees Cook wrote:
> On Sun, Sep 29, 2019 at 06:30:28PM +0200, Romain Perier wrote:
> > Now that everything has been converted to the new API, we can remove
> > tasklet_init() and replace it by tasklet_setup().
> > 
> > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> 
> If this is the last user of TASKLET_*_TYPE casts, those should get
> dropped here too.
> 
> -Kees

Good catch ! I will squash the change to this commit

Romain

Patch
diff mbox series

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 506300396db9..0e8f6bca45a4 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -672,18 +672,11 @@  static inline void tasklet_enable(struct tasklet_struct *t)
 
 extern void tasklet_kill(struct tasklet_struct *t);
 extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
-extern void tasklet_init(struct tasklet_struct *t,
+extern void tasklet_setup(struct tasklet_struct *t,
 			 void (*func)(struct tasklet_struct *));
 
 #define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
 	container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
-
-static inline void tasklet_setup(struct tasklet_struct *t,
-				 void (*callback)(struct tasklet_struct *))
-{
-	tasklet_init(t, (TASKLET_FUNC_TYPE)callback);
-}
-
 /*
  * Autoprobing for irqs:
  *
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7415a7c4b494..179dce78fff8 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -546,7 +546,7 @@  static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
 	tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
 }
 
-void tasklet_init(struct tasklet_struct *t,
+void tasklet_setup(struct tasklet_struct *t,
 		  void (*func)(struct tasklet_struct *))
 {
 	t->next = NULL;
@@ -554,7 +554,7 @@  void tasklet_init(struct tasklet_struct *t,
 	atomic_set(&t->count, 0);
 	t->func = func;
 }
-EXPORT_SYMBOL(tasklet_init);
+EXPORT_SYMBOL(tasklet_setup);
 
 void tasklet_kill(struct tasklet_struct *t)
 {