diff mbox series

[RESEND,net-next,1/8] net: dccp: convert tasklets to use new tasklet_setup() API

Message ID 20201006063201.294959-2-allen.lkml@gmail.com
State Superseded
Headers show
Series net: convert tasklets to use new | expand

Commit Message

Allen Pais Oct. 6, 2020, 6:31 a.m. UTC
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>
---
 net/dccp/timer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Jakub Kicinski Oct. 6, 2020, 2:42 p.m. UTC | #1
On Tue,  6 Oct 2020 12:01:54 +0530 Allen Pais wrote:
> --- a/net/dccp/timer.c
> +++ b/net/dccp/timer.c
> @@ -219,9 +219,10 @@ static void dccp_delack_timer(struct timer_list *t)
>   *
>   * See the comments above %ccid_dequeueing_decision for supported modes.
>   */
> -static void dccp_write_xmitlet(unsigned long data)
> +static void dccp_write_xmitlet(struct tasklet_struct *t)

net/dccp/timer.c:223: warning: Function parameter or member 't' not described in 'dccp_write_xmitlet'
net/dccp/timer.c:223: warning: Excess function parameter 'data' description in 'dccp_write_xmitlet'
Allen Pais Oct. 7, 2020, 9:40 a.m. UTC | #2
> 
> net/dccp/timer.c:223: warning: Function parameter or member 't' not described in 'dccp_write_xmitlet'
> net/dccp/timer.c:223: warning: Excess function parameter 'data' description in 'dccp_write_xmitlet'
> 
My bad. Will fix it.

Thanks.
diff mbox series

Patch

diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index a934d2932..a57d66b29 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -219,9 +219,10 @@  static void dccp_delack_timer(struct timer_list *t)
  *
  * See the comments above %ccid_dequeueing_decision for supported modes.
  */
-static void dccp_write_xmitlet(unsigned long data)
+static void dccp_write_xmitlet(struct tasklet_struct *t)
 {
-	struct sock *sk = (struct sock *)data;
+	struct dccp_sock *dp = from_tasklet(dp, t, dccps_xmitlet);
+	struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk;
 
 	bh_lock_sock(sk);
 	if (sock_owned_by_user(sk))
@@ -235,16 +236,15 @@  static void dccp_write_xmitlet(unsigned long data)
 static void dccp_write_xmit_timer(struct timer_list *t)
 {
 	struct dccp_sock *dp = from_timer(dp, t, dccps_xmit_timer);
-	struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk;
 
-	dccp_write_xmitlet((unsigned long)sk);
+	dccp_write_xmitlet(&dp->dccps_xmitlet);
 }
 
 void dccp_init_xmit_timers(struct sock *sk)
 {
 	struct dccp_sock *dp = dccp_sk(sk);
 
-	tasklet_init(&dp->dccps_xmitlet, dccp_write_xmitlet, (unsigned long)sk);
+	tasklet_setup(&dp->dccps_xmitlet, dccp_write_xmitlet);
 	timer_setup(&dp->dccps_xmit_timer, dccp_write_xmit_timer, 0);
 	inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer,
 				  &dccp_keepalive_timer);