net: ipv4: convert tasklets to use new tasklet_setup() API
authorAllen Pais <apais@linux.microsoft.com>
Tue, 3 Nov 2020 09:18:17 +0000 (14:48 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Nov 2020 18:40:56 +0000 (10:40 -0800)
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_output.c

index 9abf5a0358d54869aa91a1e1a3125c1072af7305..99905bc01d40c11f6832142adaa776ecad7b695b 100644 (file)
@@ -1038,9 +1038,9 @@ static void tcp_tsq_handler(struct sock *sk)
  * transferring tsq->head because tcp_wfree() might
  * interrupt us (non NAPI drivers)
  */
-static void tcp_tasklet_func(unsigned long data)
+static void tcp_tasklet_func(struct tasklet_struct *t)
 {
-       struct tsq_tasklet *tsq = (struct tsq_tasklet *)data;
+       struct tsq_tasklet *tsq = from_tasklet(tsq,  t, tasklet);
        LIST_HEAD(list);
        unsigned long flags;
        struct list_head *q, *n;
@@ -1125,9 +1125,7 @@ void __init tcp_tasklet_init(void)
                struct tsq_tasklet *tsq = &per_cpu(tsq_tasklet, i);
 
                INIT_LIST_HEAD(&tsq->head);
-               tasklet_init(&tsq->tasklet,
-                            tcp_tasklet_func,
-                            (unsigned long)tsq);
+               tasklet_setup(&tsq->tasklet, tcp_tasklet_func);
        }
 }