linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rangankar, Manish" <Manish.Rangankar@cavium.com>
To: Kees Cook <keescook@chromium.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Dept-Eng QLogic Storage Upstream 
	<QLogic-Storage-Upstream@cavium.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi: qla4xxx: Convert timers to use timer_setup()
Date: Wed, 1 Nov 2017 07:06:14 +0000	[thread overview]
Message-ID: <D61F6B9C.42267%manish.rangankar@cavium.com> (raw)
In-Reply-To: <20171025100743.GA145111@beast>


On 25/10/17 3:37 PM, "Kees Cook" <keescook@chromium.org> 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.
>
>Cc: QLogic-Storage-Upstream@qlogic.com
>Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.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/qla4xxx/ql4_os.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
>index 64c6fa563fdb..2b8a8ce2a431 100644
>--- a/drivers/scsi/qla4xxx/ql4_os.c
>+++ b/drivers/scsi/qla4xxx/ql4_os.c
>@@ -3955,16 +3955,15 @@ void qla4xxx_update_session_conn_param(struct
>scsi_qla_host *ha,
> /*
>  * Timer routines
>  */
>+static void qla4xxx_timer(struct timer_list *t);
> 
>-static void qla4xxx_start_timer(struct scsi_qla_host *ha, void *func,
>+static void qla4xxx_start_timer(struct scsi_qla_host *ha,
> 				unsigned long interval)
> {
> 	DEBUG(printk("scsi: %s: Starting timer thread for adapter %d\n",
> 		     __func__, ha->host->host_no));
>-	init_timer(&ha->timer);
>+	timer_setup(&ha->timer, qla4xxx_timer, 0);
> 	ha->timer.expires = jiffies + interval * HZ;
>-	ha->timer.data = (unsigned long)ha;
>-	ha->timer.function = (void (*)(unsigned long))func;
> 	add_timer(&ha->timer);
> 	ha->timer_active = 1;
> }
>@@ -4508,8 +4507,9 @@ static void qla4xxx_check_relogin_flash_ddb(struct
>iscsi_cls_session *cls_sess)
>  * qla4xxx_timer - checks every second for work to do.
>  * @ha: Pointer to host adapter structure.
>  **/
>-static void qla4xxx_timer(struct scsi_qla_host *ha)
>+static void qla4xxx_timer(struct timer_list *t)
> {
>+	struct scsi_qla_host *ha = from_timer(ha, t, timer);
> 	int start_dpc = 0;
> 	uint16_t w;
> 
>@@ -8805,7 +8805,7 @@ static int qla4xxx_probe_adapter(struct pci_dev
>*pdev,
> 	ha->isp_ops->enable_intrs(ha);
> 
> 	/* Start timer thread. */
>-	qla4xxx_start_timer(ha, qla4xxx_timer, 1);
>+	qla4xxx_start_timer(ha, 1);
> 
> 	set_bit(AF_INIT_DONE, &ha->flags);
> 
>-- 
>2.7.4


Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>

      parent reply	other threads:[~2017-11-01  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 10:07 [PATCH] scsi: qla4xxx: Convert timers to use timer_setup() Kees Cook
2017-10-31 15:51 ` Martin K. Petersen
2017-11-01  7:06 ` Rangankar, Manish [this message]

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=D61F6B9C.42267%manish.rangankar@cavium.com \
    --to=manish.rangankar@cavium.com \
    --cc=QLogic-Storage-Upstream@cavium.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).