diff options
author | Emil Renner Berthing <kernel@esmil.dk> | 2021-01-27 18:32:55 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-29 18:24:05 -0800 |
commit | a5b88632fc967906a86e16513bae9cc49070934c (patch) | |
tree | e84f3502b0d01d70cb40955f4063e2eb605ac032 /net/atm | |
parent | 810e754c7bc5ba6bc49abc576b1a33ddc0e64e37 (diff) | |
download | linux-rpi-a5b88632fc967906a86e16513bae9cc49070934c.tar.gz linux-rpi-a5b88632fc967906a86e16513bae9cc49070934c.tar.bz2 linux-rpi-a5b88632fc967906a86e16513bae9cc49070934c.zip |
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>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/pppoatm.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 579b66da1d95..5f06af098390 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c @@ -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 && @@ -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); |