Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet

Previously a temporary tasklet structure was initialized on the stack
using DECLARE_TASKLET_OLD() and then copied over and modified. Nothing
else in the kernel seems to use this pattern, so let's just call
tasklet_init() like everyone else.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Link: https://lore.kernel.org/r/20210127173256.13954-1-kernel@esmil.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Emil Renner Berthing and committed by
Jakub Kicinski
a5b88632 810e754c

+3 -7
+3 -7
net/atm/pppoatm.c
··· 389 389 struct atm_backend_ppp be; 390 390 struct pppoatm_vcc *pvcc; 391 391 int err; 392 - /* 393 - * Each PPPoATM instance has its own tasklet - this is just a 394 - * prototypical one used to initialize them 395 - */ 396 - static const DECLARE_TASKLET_OLD(tasklet_proto, pppoatm_wakeup_sender); 392 + 397 393 if (copy_from_user(&be, arg, sizeof be)) 398 394 return -EFAULT; 399 395 if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && ··· 411 415 pvcc->chan.ops = &pppoatm_ops; 412 416 pvcc->chan.mtu = atmvcc->qos.txtp.max_sdu - PPP_HDRLEN - 413 417 (be.encaps == e_vc ? 0 : LLC_LEN); 414 - pvcc->wakeup_tasklet = tasklet_proto; 415 - pvcc->wakeup_tasklet.data = (unsigned long) &pvcc->chan; 418 + tasklet_init(&pvcc->wakeup_tasklet, pppoatm_wakeup_sender, 419 + (unsigned long)&pvcc->chan); 416 420 err = ppp_register_channel(&pvcc->chan); 417 421 if (err != 0) { 418 422 kfree(pvcc);