* [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2)
@ 2017-10-17 18:37 Kees Cook
2017-10-18 15:49 ` Doug Ledford
2017-10-18 15:57 ` Saleem, Shiraz
0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2017-10-17 18:37 UTC (permalink / raw)
To: Shiraz Saleem, Doug Ledford
Cc: Faisal Latif, Sean Hefty, Hal Rosenstock, linux-kernel,
linux-rdma
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.
This includes the remaining timers missed in the earlier i40iw patch.
Cc: Faisal Latif <faisal.latif@intel.com>
Cc: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/infiniband/hw/i40iw/i40iw_cm.c | 7 +++----
drivers/infiniband/hw/i40iw/i40iw_utils.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 50c43766defd..789d925df227 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -1188,7 +1188,7 @@ static void i40iw_handle_close_entry(struct i40iw_cm_node *cm_node, u32 rem_node
* i40iw_cm_timer_tick - system's timer expired callback
* @pass: Pointing to cm_core
*/
-static void i40iw_cm_timer_tick(unsigned long pass)
+static void i40iw_cm_timer_tick(struct timer_list *t)
{
unsigned long nexttimeout = jiffies + I40IW_LONG_TIME;
struct i40iw_cm_node *cm_node;
@@ -1196,7 +1196,7 @@ static void i40iw_cm_timer_tick(unsigned long pass)
struct list_head *list_core_temp;
struct i40iw_sc_vsi *vsi;
struct list_head *list_node;
- struct i40iw_cm_core *cm_core = (struct i40iw_cm_core *)pass;
+ struct i40iw_cm_core *cm_core = from_timer(cm_core, t, tcp_timer);
u32 settimer = 0;
unsigned long timetosend;
struct i40iw_sc_dev *dev;
@@ -3202,8 +3202,7 @@ void i40iw_setup_cm_core(struct i40iw_device *iwdev)
INIT_LIST_HEAD(&cm_core->connected_nodes);
INIT_LIST_HEAD(&cm_core->listen_nodes);
- setup_timer(&cm_core->tcp_timer, i40iw_cm_timer_tick,
- (unsigned long)cm_core);
+ timer_setup(&cm_core->tcp_timer, i40iw_cm_timer_tick, 0);
spin_lock_init(&cm_core->ht_lock);
spin_lock_init(&cm_core->listen_list_lock);
diff --git a/drivers/infiniband/hw/i40iw/i40iw_utils.c b/drivers/infiniband/hw/i40iw/i40iw_utils.c
index f6c76595e834..2ed31004b19c 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_utils.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_utils.c
@@ -870,9 +870,9 @@ void i40iw_terminate_done(struct i40iw_sc_qp *qp, int timeout_occurred)
* i40iw_terminate_imeout - timeout happened
* @context: points to iwarp qp
*/
-static void i40iw_terminate_timeout(unsigned long context)
+static void i40iw_terminate_timeout(struct timer_list *t)
{
- struct i40iw_qp *iwqp = (struct i40iw_qp *)context;
+ struct i40iw_qp *iwqp = from_timer(iwqp, t, terminate_timer);
struct i40iw_sc_qp *qp = (struct i40iw_sc_qp *)&iwqp->sc_qp;
i40iw_terminate_done(qp, 1);
@@ -889,8 +889,7 @@ void i40iw_terminate_start_timer(struct i40iw_sc_qp *qp)
iwqp = (struct i40iw_qp *)qp->back_qp;
i40iw_add_ref(&iwqp->ibqp);
- setup_timer(&iwqp->terminate_timer, i40iw_terminate_timeout,
- (unsigned long)iwqp);
+ timer_setup(&iwqp->terminate_timer, i40iw_terminate_timeout, 0);
iwqp->terminate_timer.expires = jiffies + HZ;
add_timer(&iwqp->terminate_timer);
}
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2)
2017-10-17 18:37 [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2) Kees Cook
@ 2017-10-18 15:49 ` Doug Ledford
2017-10-18 15:57 ` Saleem, Shiraz
1 sibling, 0 replies; 3+ messages in thread
From: Doug Ledford @ 2017-10-18 15:49 UTC (permalink / raw)
To: Kees Cook, Shiraz Saleem
Cc: Faisal Latif, Sean Hefty, Hal Rosenstock, linux-kernel,
linux-rdma
On Tue, 2017-10-17 at 11:37 -0700, Kees Cook wrote:
> 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.
>
> This includes the remaining timers missed in the earlier i40iw patch.
>
> Cc: Faisal Latif <faisal.latif@intel.com>
> Cc: Shiraz Saleem <shiraz.saleem@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
Thanks, applied.
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2)
2017-10-17 18:37 [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2) Kees Cook
2017-10-18 15:49 ` Doug Ledford
@ 2017-10-18 15:57 ` Saleem, Shiraz
1 sibling, 0 replies; 3+ messages in thread
From: Saleem, Shiraz @ 2017-10-18 15:57 UTC (permalink / raw)
To: Kees Cook, Doug Ledford
Cc: Latif, Faisal, Hefty, Sean, Hal Rosenstock,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org
> Subject: [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2)
>
> 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.
>
> This includes the remaining timers missed in the earlier i40iw patch.
>
> Cc: Faisal Latif <faisal.latif@intel.com>
> Cc: Shiraz Saleem <shiraz.saleem@intel.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Sean Hefty <sean.hefty@intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Cc: linux-rdma@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
Thanks!
Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-18 15:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 18:37 [PATCH] RDMA/i40iw: Convert timers to use timer_setup() (part 2) Kees Cook
2017-10-18 15:49 ` Doug Ledford
2017-10-18 15:57 ` Saleem, Shiraz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox