Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d290d69 authored by Kees Cook's avatar Kees Cook Committed by Doug Ledford
Browse files

IB/ipoib: 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: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Alex Vesker <valex@mellanox.com>
Cc: Erez Shitrit <erezsh@mellanox.com>
Cc: Zhu Yanjun <yanjun.zhu@oracle.com>
Cc: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Yuval Shaia <yuval.shaia@oracle.com>
Cc: linux-rdma@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 605cbb2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ void ipoib_mark_paths_invalid(struct net_device *dev);
void ipoib_flush_paths(struct net_device *dev);
struct ipoib_dev_priv *ipoib_intf_alloc(struct ib_device *hca, u8 port,
					const char *format);
void ipoib_ib_tx_timer_func(unsigned long ctx);
void ipoib_ib_tx_timer_func(struct timer_list *t);
void ipoib_ib_dev_flush_light(struct work_struct *work);
void ipoib_ib_dev_flush_normal(struct work_struct *work);
void ipoib_ib_dev_flush_heavy(struct work_struct *work);
+4 −2
Original line number Diff line number Diff line
@@ -821,9 +821,11 @@ int ipoib_ib_dev_stop(struct net_device *dev)
	return 0;
}

void ipoib_ib_tx_timer_func(unsigned long ctx)
void ipoib_ib_tx_timer_func(struct timer_list *t)
{
	drain_tx_cq((struct net_device *)ctx);
	struct ipoib_dev_priv *priv = from_timer(priv, t, poll_timer);

	drain_tx_cq(priv->dev);
}

int ipoib_ib_dev_open_default(struct net_device *dev)
+1 −2
Original line number Diff line number Diff line
@@ -1666,8 +1666,7 @@ static int ipoib_dev_init_default(struct net_device *dev)
	priv->dev->dev_addr[2] = (priv->qp->qp_num >>  8) & 0xff;
	priv->dev->dev_addr[3] = (priv->qp->qp_num) & 0xff;

	setup_timer(&priv->poll_timer, ipoib_ib_tx_timer_func,
		    (unsigned long)dev);
	timer_setup(&priv->poll_timer, ipoib_ib_tx_timer_func, 0);

	return 0;