Skip to content

Commit

Permalink
net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
esmil authored and kuba-moo committed Jan 30, 2021
1 parent 810e754 commit a5b8863
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions net/atm/pppoatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
struct atm_backend_ppp be;
struct pppoatm_vcc *pvcc;
int err;
/*
* Each PPPoATM instance has its own tasklet - this is just a
* prototypical one used to initialize them
*/
static const DECLARE_TASKLET_OLD(tasklet_proto, pppoatm_wakeup_sender);

if (copy_from_user(&be, arg, sizeof be))
return -EFAULT;
if (be.encaps != PPPOATM_ENCAPS_AUTODETECT &&
Expand All @@ -415,8 +411,8 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
pvcc->chan.ops = &pppoatm_ops;
pvcc->chan.mtu = atmvcc->qos.txtp.max_sdu - PPP_HDRLEN -
(be.encaps == e_vc ? 0 : LLC_LEN);
pvcc->wakeup_tasklet = tasklet_proto;
pvcc->wakeup_tasklet.data = (unsigned long) &pvcc->chan;
tasklet_init(&pvcc->wakeup_tasklet, pppoatm_wakeup_sender,
(unsigned long)&pvcc->chan);
err = ppp_register_channel(&pvcc->chan);
if (err != 0) {
kfree(pvcc);
Expand Down

0 comments on commit a5b8863

Please sign in to comment.