From: Allen Pais <allen.lkml@gmail.com>
To: davem@davemloft.net
Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com,
cooldavid@cooldavid.org, mlindner@marvell.com,
stephen@networkplumber.org, borisp@mellanox.com,
netdev@vger.kernel.org, Allen Pais <allen.lkml@gmail.com>,
Romain Perier <romain.perier@gmail.com>
Subject: [PATCH v2 11/20] ethernet: jme: convert tasklets to use new tasklet_setup() API
Date: Wed, 9 Sep 2020 14:15:01 +0530 [thread overview]
Message-ID: <20200909084510.648706-12-allen.lkml@gmail.com> (raw)
In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com>
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 <allen.lkml@gmail.com>
---
drivers/net/ethernet/jme.c | 40 +++++++++++++++-----------------------
1 file changed, 16 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index ddc757680089..e9efe074edc1 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -1187,9 +1187,9 @@ jme_shutdown_nic(struct jme_adapter *jme)
}
static void
-jme_pcc_tasklet(unsigned long arg)
+jme_pcc_tasklet(struct tasklet_struct *t)
{
- struct jme_adapter *jme = (struct jme_adapter *)arg;
+ struct jme_adapter *jme = from_tasklet(jme, t, pcc_task);
struct net_device *netdev = jme->dev;
if (unlikely(test_bit(JME_FLAG_SHUTDOWN, &jme->flags))) {
@@ -1265,10 +1265,9 @@ jme_stop_shutdown_timer(struct jme_adapter *jme)
jwrite32f(jme, JME_APMC, apmc);
}
-static void
-jme_link_change_tasklet(unsigned long arg)
+static void jme_link_change_tasklet(struct tasklet_struct *t)
{
- struct jme_adapter *jme = (struct jme_adapter *)arg;
+ struct jme_adapter *jme = from_tasklet(jme, t, linkch_task);
struct net_device *netdev = jme->dev;
int rc;
@@ -1345,9 +1344,9 @@ jme_link_change_tasklet(unsigned long arg)
}
static void
-jme_rx_clean_tasklet(unsigned long arg)
+jme_rx_clean_tasklet(struct tasklet_struct *t)
{
- struct jme_adapter *jme = (struct jme_adapter *)arg;
+ struct jme_adapter *jme = from_tasklet(jme, t, rxclean_task);
struct dynpcc_info *dpi = &(jme->dpi);
jme_process_receive(jme, jme->rx_ring_size);
@@ -1380,9 +1379,9 @@ jme_poll(JME_NAPI_HOLDER(holder), JME_NAPI_WEIGHT(budget))
}
static void
-jme_rx_empty_tasklet(unsigned long arg)
+jme_rx_empty_tasklet(struct tasklet_struct *t)
{
- struct jme_adapter *jme = (struct jme_adapter *)arg;
+ struct jme_adapter *jme = from_tasklet(jme, t, rxempty_task);
if (unlikely(atomic_read(&jme->link_changing) != 1))
return;
@@ -1392,7 +1391,7 @@ jme_rx_empty_tasklet(unsigned long arg)
netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n");
- jme_rx_clean_tasklet(arg);
+ jme_rx_clean_tasklet(&jme->rxclean_task);
while (atomic_read(&jme->rx_empty) > 0) {
atomic_dec(&jme->rx_empty);
@@ -1416,10 +1415,9 @@ jme_wake_queue_if_stopped(struct jme_adapter *jme)
}
-static void
-jme_tx_clean_tasklet(unsigned long arg)
+static void jme_tx_clean_tasklet(struct tasklet_struct *t)
{
- struct jme_adapter *jme = (struct jme_adapter *)arg;
+ struct jme_adapter *jme = from_tasklet(jme, t, txclean_task);
struct jme_ring *txring = &(jme->txring[0]);
struct txdesc *txdesc = txring->desc;
struct jme_buffer_info *txbi = txring->bufinf, *ctxbi, *ttxbi;
@@ -1834,14 +1832,10 @@ jme_open(struct net_device *netdev)
jme_clear_pm_disable_wol(jme);
JME_NAPI_ENABLE(jme);
- tasklet_init(&jme->linkch_task, jme_link_change_tasklet,
- (unsigned long) jme);
- tasklet_init(&jme->txclean_task, jme_tx_clean_tasklet,
- (unsigned long) jme);
- tasklet_init(&jme->rxclean_task, jme_rx_clean_tasklet,
- (unsigned long) jme);
- tasklet_init(&jme->rxempty_task, jme_rx_empty_tasklet,
- (unsigned long) jme);
+ tasklet_setup(&jme->linkch_task, jme_link_change_tasklet);
+ tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet);
+ tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet);
+ tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet);
rc = jme_request_irq(jme);
if (rc)
@@ -3040,9 +3034,7 @@ jme_init_one(struct pci_dev *pdev,
atomic_set(&jme->tx_cleaning, 1);
atomic_set(&jme->rx_empty, 1);
- tasklet_init(&jme->pcc_task,
- jme_pcc_tasklet,
- (unsigned long) jme);
+ tasklet_setup(&jme->pcc_task, jme_pcc_tasklet);
jme->dpi.cur = PCC_P1;
jme->reg_ghc = 0;
--
2.25.1
next prev parent reply other threads:[~2020-09-09 8:46 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 8:44 [PATCH v2 00/20] ethernet: convert tasklets to use new Allen Pais
2020-09-09 8:44 ` [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API Allen Pais
2020-09-09 18:09 ` David Miller
2020-09-09 18:36 ` Allen
2020-09-09 21:33 ` David Miller
2020-09-11 5:53 ` Allen
2020-09-11 10:00 ` Allen
2020-09-11 20:20 ` David Miller
2020-09-09 8:44 ` [PATCH v2 02/20] ethernet: amd: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 03/20] broadcom: cnic: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 04/20] ethernet: cadence: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 05/20] ethernet: cavium: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 06/20] ethernet: chelsio: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 07/20] ethernet: dlink: " Allen Pais
2020-09-09 18:11 ` David Miller
2020-09-09 8:44 ` [PATCH v2 08/20] ethernet: hinic: " Allen Pais
2020-09-09 8:44 ` [PATCH v2 09/20] ethernet: ehea: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 10/20] ethernet: ibmvnic: " Allen Pais
2020-09-09 8:45 ` Allen Pais [this message]
2020-09-09 8:45 ` [PATCH v2 12/20] ethernet: marvell: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 13/20] ethernet: mellanox: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 14/20] ethernet: micrel: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 15/20] ethernet: natsemi: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 16/20] ethernet: netronome: " Allen Pais
2020-09-09 15:46 ` Jakub Kicinski
2020-09-09 16:28 ` Simon Horman
2020-09-09 8:45 ` [PATCH v2 17/20] ethernet: ni: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 18/20] ethernet: qlogic: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 19/20] ethernet: silan: " Allen Pais
2020-09-09 8:45 ` [PATCH v2 20/20] ethernet: smsc: " Allen Pais
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200909084510.648706-12-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=borisp@mellanox.com \
--cc=cooldavid@cooldavid.org \
--cc=davem@davemloft.net \
--cc=dougmill@linux.ibm.com \
--cc=jes@trained-monkey.org \
--cc=kuba@kernel.org \
--cc=mlindner@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=romain.perier@gmail.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).