* [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet
@ 2021-01-27 17:32 Emil Renner Berthing
2021-01-27 17:32 ` [PATCH 2/2] net: atm: pppoatm: use new API for " Emil Renner Berthing
2021-01-30 2:30 ` [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize " patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Emil Renner Berthing @ 2021-01-27 17:32 UTC (permalink / raw)
To: netdev
Cc: Emil Renner Berthing, Mitchell Blank Jr, David S. Miller,
Jakub Kicinski, linux-kernel
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>
---
net/atm/pppoatm.c | 10 +++-------
1 file 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);
--
2.30.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] net: atm: pppoatm: use new API for wakeup tasklet
2021-01-27 17:32 [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet Emil Renner Berthing
@ 2021-01-27 17:32 ` Emil Renner Berthing
2021-01-30 2:30 ` [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize " patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Emil Renner Berthing @ 2021-01-27 17:32 UTC (permalink / raw)
To: netdev
Cc: Emil Renner Berthing, Mitchell Blank Jr, David S. Miller,
Jakub Kicinski, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
net/atm/pppoatm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 5f06af098390..3e4f17d335fe 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -101,9 +101,11 @@ static inline struct pppoatm_vcc *chan_to_pvcc(const struct ppp_channel *chan)
* doesn't want to be called in interrupt context, so we do it from
* a tasklet
*/
-static void pppoatm_wakeup_sender(unsigned long arg)
+static void pppoatm_wakeup_sender(struct tasklet_struct *t)
{
- ppp_output_wakeup((struct ppp_channel *) arg);
+ struct pppoatm_vcc *pvcc = from_tasklet(pvcc, t, wakeup_tasklet);
+
+ ppp_output_wakeup(&pvcc->chan);
}
static void pppoatm_release_cb(struct atm_vcc *atmvcc)
@@ -411,8 +413,7 @@ 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);
- tasklet_init(&pvcc->wakeup_tasklet, pppoatm_wakeup_sender,
- (unsigned long)&pvcc->chan);
+ tasklet_setup(&pvcc->wakeup_tasklet, pppoatm_wakeup_sender);
err = ppp_register_channel(&pvcc->chan);
if (err != 0) {
kfree(pvcc);
--
2.30.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet
2021-01-27 17:32 [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet Emil Renner Berthing
2021-01-27 17:32 ` [PATCH 2/2] net: atm: pppoatm: use new API for " Emil Renner Berthing
@ 2021-01-30 2:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-30 2:30 UTC (permalink / raw)
To: Emil Renner Berthing; +Cc: netdev, mitch, davem, kuba, linux-kernel
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Wed, 27 Jan 2021 18:32:55 +0100 you wrote:
> 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>
>
> [...]
Here is the summary with links:
- [1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet
https://git.kernel.org/netdev/net-next/c/a5b88632fc96
- [2/2] net: atm: pppoatm: use new API for wakeup tasklet
https://git.kernel.org/netdev/net-next/c/a58745979cdd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-30 6:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 17:32 [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize wakeup tasklet Emil Renner Berthing
2021-01-27 17:32 ` [PATCH 2/2] net: atm: pppoatm: use new API for " Emil Renner Berthing
2021-01-30 2:30 ` [PATCH 1/2] net: atm: pppoatm: use tasklet_init to initialize " patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.