drivers/net: amd: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Allen Pais <allen.lkml@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kees Cook
2017-10-26 22:54:38 -07:00
committed by David S. Miller
parent c63144e4dd
commit c6c52ba151
7 changed files with 37 additions and 28 deletions

View File

@@ -642,9 +642,9 @@ static irqreturn_t xgbe_dma_isr(int irq, void *data)
return IRQ_HANDLED;
}
static void xgbe_tx_timer(unsigned long data)
static void xgbe_tx_timer(struct timer_list *t)
{
struct xgbe_channel *channel = (struct xgbe_channel *)data;
struct xgbe_channel *channel = from_timer(channel, t, tx_timer);
struct xgbe_prv_data *pdata = channel->pdata;
struct napi_struct *napi;
@@ -680,9 +680,9 @@ static void xgbe_service(struct work_struct *work)
pdata->phy_if.phy_status(pdata);
}
static void xgbe_service_timer(unsigned long data)
static void xgbe_service_timer(struct timer_list *t)
{
struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data;
struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer);
queue_work(pdata->dev_workqueue, &pdata->service_work);
@@ -694,16 +694,14 @@ static void xgbe_init_timers(struct xgbe_prv_data *pdata)
struct xgbe_channel *channel;
unsigned int i;
setup_timer(&pdata->service_timer, xgbe_service_timer,
(unsigned long)pdata);
timer_setup(&pdata->service_timer, xgbe_service_timer, 0);
for (i = 0; i < pdata->channel_count; i++) {
channel = pdata->channel[i];
if (!channel->tx_ring)
break;
setup_timer(&channel->tx_timer, xgbe_tx_timer,
(unsigned long)channel);
timer_setup(&channel->tx_timer, xgbe_tx_timer, 0);
}
}