mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Himanshu Madhani <Himanshu.Madhani@cavium.com>
Cc: Kees Cook <keescook@chromium.org>,
	Bart Van Assche <bart.vanassche@wdc.com>,
	qla2xxx-upstream@qlogic.com,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] scsi: qla2xxx: Convert timers to use setup_timer()
Date: Tue, 31 Oct 2017 12:13:46 -0700	[thread overview]
Message-ID: <1509477229-62141-2-git-send-email-keescook@chromium.org> (raw)
In-Reply-To: <1509477229-62141-1-git-send-email-keescook@chromium.org>

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, take the first step by switching from init_timer() and
open-coded .function and .data assignments to using the old setup_timer()
API.

Cc: Himanshu Madhani <Himanshu.Madhani@cavium.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: qla2xxx-upstream@qlogic.com
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/scsi/qla2xxx/qla_inline.h | 5 ++---
 drivers/scsi/qla2xxx/qla_os.c     | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index 9a2c86eacf44..34cdb5d9c87c 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -269,10 +269,9 @@ qla2x00_rel_sp(srb_t *sp)
 static inline void
 qla2x00_init_timer(srb_t *sp, unsigned long tmo)
 {
-	init_timer(&sp->u.iocb_cmd.timer);
+	setup_timer(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,
+		    (unsigned long)sp);
 	sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ;
-	sp->u.iocb_cmd.timer.data = (unsigned long)sp;
-	sp->u.iocb_cmd.timer.function = qla2x00_sp_timeout;
 	add_timer(&sp->u.iocb_cmd.timer);
 	sp->free = qla2x00_sp_free;
 	if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD))
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3bd956d3bc5d..6c10a7b970c0 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -332,10 +332,9 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL;
 __inline__ void
 qla2x00_start_timer(scsi_qla_host_t *vha, void *func, unsigned long interval)
 {
-	init_timer(&vha->timer);
+	setup_timer(&vha->timer, (void (*)(unsigned long))func,
+		    (unsigned long)vha);
 	vha->timer.expires = jiffies + interval * HZ;
-	vha->timer.data = (unsigned long)vha;
-	vha->timer.function = (void (*)(unsigned long))func;
 	add_timer(&vha->timer);
 	vha->timer_active = 1;
 }
-- 
2.7.4

  reply	other threads:[~2017-10-31 19:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 19:13 [PATCH 0/4] scsi: qla2xxx: Convert timers to use timer_setup() Kees Cook
2017-10-31 19:13 ` Kees Cook [this message]
2017-10-31 19:13 ` [PATCH 2/4] scsi: qla2xxx: Refactor qla2x00_start_timer() Kees Cook
2017-10-31 19:13 ` [PATCH 3/4] scsi: qla2xxx: Convert qla2x00_timer() to use timer_setup() Kees Cook
2017-10-31 19:13 ` [PATCH 4/4] scsi: qla2xxx: Convert qla2x00_sp_timeout() " Kees Cook
2017-11-01 18:46 ` [PATCH 0/4] scsi: qla2xxx: Convert timers " Kees Cook
2017-11-01 19:18   ` Madhani, Himanshu
2017-11-06  0:18     ` Bart Van Assche
2017-11-06 19:58       ` Madhani, Himanshu
2017-11-07  4:30         ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509477229-62141-2-git-send-email-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=Himanshu.Madhani@cavium.com \
    --cc=bart.vanassche@wdc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®