* [PATCH v2] IB/i40iw: use setup_timer
[not found] <9DD61F30A802C4429A01CA4200E302A730314A7F@fmsmsx116.amr.corp.intel.com>
@ 2017-04-29 1:37 ` Geliang Tang
2017-04-29 13:45 ` Doug Ledford
0 siblings, 1 reply; 3+ messages in thread
From: Geliang Tang @ 2017-04-29 1:37 UTC (permalink / raw)
To: Faisal Latif, Shiraz Saleem, Doug Ledford, Sean Hefty, Hal Rosenstock
Cc: Geliang Tang, linux-rdma, linux-kernel
Use setup_timer() instead of init_timer() to simplify the code.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
Changes in v2:
- use setup_timer() in i40iw_terminate_start_timer().
---
drivers/infiniband/hw/i40iw/i40iw_cm.c | 5 ++---
drivers/infiniband/hw/i40iw/i40iw_utils.c | 10 ++++------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 95a0586..f3bc01b 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -3184,9 +3184,8 @@ void i40iw_setup_cm_core(struct i40iw_device *iwdev)
INIT_LIST_HEAD(&cm_core->connected_nodes);
INIT_LIST_HEAD(&cm_core->listen_nodes);
- init_timer(&cm_core->tcp_timer);
- cm_core->tcp_timer.function = i40iw_cm_timer_tick;
- cm_core->tcp_timer.data = (unsigned long)cm_core;
+ setup_timer(&cm_core->tcp_timer, i40iw_cm_timer_tick,
+ (unsigned long)cm_core);
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 70c3e9e..409a378 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_utils.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_utils.c
@@ -844,10 +844,9 @@ void i40iw_terminate_start_timer(struct i40iw_sc_qp *qp)
iwqp = (struct i40iw_qp *)qp->back_qp;
i40iw_add_ref(&iwqp->ibqp);
- init_timer(&iwqp->terminate_timer);
- iwqp->terminate_timer.function = i40iw_terminate_timeout;
+ setup_timer(&iwqp->terminate_timer, i40iw_terminate_timeout,
+ (unsigned long)iwqp);
iwqp->terminate_timer.expires = jiffies + HZ;
- iwqp->terminate_timer.data = (unsigned long)iwqp;
add_timer(&iwqp->terminate_timer);
}
@@ -1436,9 +1435,8 @@ void i40iw_hw_stats_start_timer(struct i40iw_sc_vsi *vsi)
{
struct i40iw_vsi_pestat *devstat = vsi->pestat;
- init_timer(&devstat->stats_timer);
- devstat->stats_timer.function = i40iw_hw_stats_timeout;
- devstat->stats_timer.data = (unsigned long)vsi;
+ setup_timer(&devstat->stats_timer, i40iw_hw_stats_timeout,
+ (unsigned long)vsi);
mod_timer(&devstat->stats_timer,
jiffies + msecs_to_jiffies(STATS_TIMER_DELAY));
}
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] IB/i40iw: use setup_timer
2017-04-29 1:37 ` [PATCH v2] IB/i40iw: use setup_timer Geliang Tang
@ 2017-04-29 13:45 ` Doug Ledford
2017-05-02 14:51 ` Geliang Tang
0 siblings, 1 reply; 3+ messages in thread
From: Doug Ledford @ 2017-04-29 13:45 UTC (permalink / raw)
To: Geliang Tang, Faisal Latif, Shiraz Saleem, Sean Hefty, Hal Rosenstock
Cc: linux-rdma, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]
On 4/28/2017 9:37 PM, Geliang Tang wrote:
> Use setup_timer() instead of init_timer() to simplify the code.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> Changes in v2:
> - use setup_timer() in i40iw_terminate_start_timer().
I already applied your previous patch and did the fixup to add
i40iw_terminate_start_timer() into the patch myself. Thanks.
--
Doug Ledford <dledford@redhat.com>
GPG Key ID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] IB/i40iw: use setup_timer
2017-04-29 13:45 ` Doug Ledford
@ 2017-05-02 14:51 ` Geliang Tang
0 siblings, 0 replies; 3+ messages in thread
From: Geliang Tang @ 2017-05-02 14:51 UTC (permalink / raw)
To: Doug Ledford
Cc: Faisal Latif, Shiraz Saleem, Sean Hefty, Hal Rosenstock,
linux-rdma, linux-kernel
On Sat, Apr 29, 2017 at 09:45:27AM -0400, Doug Ledford wrote:
> On 4/28/2017 9:37 PM, Geliang Tang wrote:
> > Use setup_timer() instead of init_timer() to simplify the code.
> >
> > Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> > ---
> > Changes in v2:
> > - use setup_timer() in i40iw_terminate_start_timer().
>
> I already applied your previous patch and did the fixup to add
> i40iw_terminate_start_timer() into the patch myself. Thanks.
>
>
> --
> Doug Ledford <dledford@redhat.com>
> GPG Key ID: B826A3330E572FDD
> Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
>
Thank you, Doug.
-Geliang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-02 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <9DD61F30A802C4429A01CA4200E302A730314A7F@fmsmsx116.amr.corp.intel.com>
2017-04-29 1:37 ` [PATCH v2] IB/i40iw: use setup_timer Geliang Tang
2017-04-29 13:45 ` Doug Ledford
2017-05-02 14:51 ` Geliang Tang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).