net: jme: convert tasklets to use new tasklet_setup() API

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 <apais@linux.microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Allen Pais 2020-09-14 12:59:30 +05:30 коммит произвёл David S. Miller
Родитель aa7c3fee42
Коммит 4d07f7e240
1 изменённых файлов: 16 добавлений и 24 удалений

Просмотреть файл

@ -1187,9 +1187,9 @@ jme_shutdown_nic(struct jme_adapter *jme)
} }
static void 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; struct net_device *netdev = jme->dev;
if (unlikely(test_bit(JME_FLAG_SHUTDOWN, &jme->flags))) { 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); jwrite32f(jme, JME_APMC, apmc);
} }
static void static void jme_link_change_tasklet(struct tasklet_struct *t)
jme_link_change_tasklet(unsigned long arg)
{ {
struct jme_adapter *jme = (struct jme_adapter *)arg; struct jme_adapter *jme = from_tasklet(jme, t, linkch_task);
struct net_device *netdev = jme->dev; struct net_device *netdev = jme->dev;
int rc; int rc;
@ -1345,9 +1344,9 @@ out:
} }
static void 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); struct dynpcc_info *dpi = &(jme->dpi);
jme_process_receive(jme, jme->rx_ring_size); jme_process_receive(jme, jme->rx_ring_size);
@ -1380,9 +1379,9 @@ jme_poll(JME_NAPI_HOLDER(holder), JME_NAPI_WEIGHT(budget))
} }
static void 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)) if (unlikely(atomic_read(&jme->link_changing) != 1))
return; return;
@ -1392,7 +1391,7 @@ jme_rx_empty_tasklet(unsigned long arg)
netif_info(jme, rx_status, jme->dev, "RX Queue Full!\n"); 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) { while (atomic_read(&jme->rx_empty) > 0) {
atomic_dec(&jme->rx_empty); atomic_dec(&jme->rx_empty);
@ -1416,10 +1415,9 @@ jme_wake_queue_if_stopped(struct jme_adapter *jme)
} }
static void static void jme_tx_clean_tasklet(struct tasklet_struct *t)
jme_tx_clean_tasklet(unsigned long arg)
{ {
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 jme_ring *txring = &(jme->txring[0]);
struct txdesc *txdesc = txring->desc; struct txdesc *txdesc = txring->desc;
struct jme_buffer_info *txbi = txring->bufinf, *ctxbi, *ttxbi; 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_clear_pm_disable_wol(jme);
JME_NAPI_ENABLE(jme); JME_NAPI_ENABLE(jme);
tasklet_init(&jme->linkch_task, jme_link_change_tasklet, tasklet_setup(&jme->linkch_task, jme_link_change_tasklet);
(unsigned long) jme); tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet);
tasklet_init(&jme->txclean_task, jme_tx_clean_tasklet, tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet);
(unsigned long) jme); tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet);
tasklet_init(&jme->rxclean_task, jme_rx_clean_tasklet,
(unsigned long) jme);
tasklet_init(&jme->rxempty_task, jme_rx_empty_tasklet,
(unsigned long) jme);
rc = jme_request_irq(jme); rc = jme_request_irq(jme);
if (rc) if (rc)
@ -3040,9 +3034,7 @@ jme_init_one(struct pci_dev *pdev,
atomic_set(&jme->tx_cleaning, 1); atomic_set(&jme->tx_cleaning, 1);
atomic_set(&jme->rx_empty, 1); atomic_set(&jme->rx_empty, 1);
tasklet_init(&jme->pcc_task, tasklet_setup(&jme->pcc_task, jme_pcc_tasklet);
jme_pcc_tasklet,
(unsigned long) jme);
jme->dpi.cur = PCC_P1; jme->dpi.cur = PCC_P1;
jme->reg_ghc = 0; jme->reg_ghc = 0;