net: vxge: 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: Jon Mason <jdmason@kudzu.us> Cc: "David S. Miller" <davem@davemloft.net> Cc: Miroslav Lichvar <mlichvar@redhat.com> Cc: Jarod Wilson <jarod@redhat.com> Cc: Eric Dumazet <edumazet@google.com> Cc: stephen hemminger <stephen@networkplumber.org> 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:
parent
d3e99b2d19
commit
5a3a896203
|
@ -2597,9 +2597,9 @@ INTA_MODE:
|
||||||
return VXGE_HW_OK;
|
return VXGE_HW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vxge_poll_vp_reset(unsigned long data)
|
static void vxge_poll_vp_reset(struct timer_list *t)
|
||||||
{
|
{
|
||||||
struct vxgedev *vdev = (struct vxgedev *)data;
|
struct vxgedev *vdev = from_timer(vdev, t, vp_reset_timer);
|
||||||
int i, j = 0;
|
int i, j = 0;
|
||||||
|
|
||||||
for (i = 0; i < vdev->no_of_vpath; i++) {
|
for (i = 0; i < vdev->no_of_vpath; i++) {
|
||||||
|
@ -2616,9 +2616,9 @@ static void vxge_poll_vp_reset(unsigned long data)
|
||||||
mod_timer(&vdev->vp_reset_timer, jiffies + HZ / 2);
|
mod_timer(&vdev->vp_reset_timer, jiffies + HZ / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vxge_poll_vp_lockup(unsigned long data)
|
static void vxge_poll_vp_lockup(struct timer_list *t)
|
||||||
{
|
{
|
||||||
struct vxgedev *vdev = (struct vxgedev *)data;
|
struct vxgedev *vdev = from_timer(vdev, t, vp_lockup_timer);
|
||||||
enum vxge_hw_status status = VXGE_HW_OK;
|
enum vxge_hw_status status = VXGE_HW_OK;
|
||||||
struct vxge_vpath *vpath;
|
struct vxge_vpath *vpath;
|
||||||
struct vxge_ring *ring;
|
struct vxge_ring *ring;
|
||||||
|
@ -2858,12 +2858,12 @@ static int vxge_open(struct net_device *dev)
|
||||||
vdev->config.rx_pause_enable);
|
vdev->config.rx_pause_enable);
|
||||||
|
|
||||||
if (vdev->vp_reset_timer.function == NULL)
|
if (vdev->vp_reset_timer.function == NULL)
|
||||||
vxge_os_timer(&vdev->vp_reset_timer, vxge_poll_vp_reset, vdev,
|
vxge_os_timer(&vdev->vp_reset_timer, vxge_poll_vp_reset,
|
||||||
HZ / 2);
|
HZ / 2);
|
||||||
|
|
||||||
/* There is no need to check for RxD leak and RxD lookup on Titan1A */
|
/* There is no need to check for RxD leak and RxD lookup on Titan1A */
|
||||||
if (vdev->titan1 && vdev->vp_lockup_timer.function == NULL)
|
if (vdev->titan1 && vdev->vp_lockup_timer.function == NULL)
|
||||||
vxge_os_timer(&vdev->vp_lockup_timer, vxge_poll_vp_lockup, vdev,
|
vxge_os_timer(&vdev->vp_lockup_timer, vxge_poll_vp_lockup,
|
||||||
HZ / 2);
|
HZ / 2);
|
||||||
|
|
||||||
set_bit(__VXGE_STATE_CARD_UP, &vdev->state);
|
set_bit(__VXGE_STATE_CARD_UP, &vdev->state);
|
||||||
|
|
|
@ -417,12 +417,10 @@ struct vxge_tx_priv {
|
||||||
module_param(p, int, 0)
|
module_param(p, int, 0)
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
void vxge_os_timer(struct timer_list *timer, void (*func)(unsigned long data),
|
void vxge_os_timer(struct timer_list *timer, void (*func)(struct timer_list *),
|
||||||
struct vxgedev *vdev, unsigned long timeout)
|
unsigned long timeout)
|
||||||
{
|
{
|
||||||
init_timer(timer);
|
timer_setup(timer, func, 0);
|
||||||
timer->function = func;
|
|
||||||
timer->data = (unsigned long)vdev;
|
|
||||||
mod_timer(timer, jiffies + timeout);
|
mod_timer(timer, jiffies + timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue