From patchwork Wed Oct 25 10:07:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10026353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 095A760375 for ; Wed, 25 Oct 2017 10:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03434283F9 for ; Wed, 25 Oct 2017 10:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC54628B2A; Wed, 25 Oct 2017 10:08:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EAE5283F9 for ; Wed, 25 Oct 2017 10:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932555AbdJYKHu (ORCPT ); Wed, 25 Oct 2017 06:07:50 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:57220 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932456AbdJYKHq (ORCPT ); Wed, 25 Oct 2017 06:07:46 -0400 Received: by mail-pf0-f194.google.com with SMTP id b85so21850591pfj.13 for ; Wed, 25 Oct 2017 03:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=VwyXRJHr+DtlTFUXa3C8HJaApq31w64GklkCCE8+yG8=; b=M73G8W2ywvqLOWHAtqACFPpOQYWQlEd8kR1aN5TXOkUh7Wg6yOaxTFPKAZkxkeTnpj 3mRJ845hY0XqhsCftPH2euu2ySJmUpjKmKHfiFy7WB+QnZVGpxlhqFJ6Pc4a17E9JHG1 DAf8QpF4y/FSaydYK2ysjfCoIS+lp7D4CSusc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=VwyXRJHr+DtlTFUXa3C8HJaApq31w64GklkCCE8+yG8=; b=gvc0NBis9gSlQSeHLPZPiU4rXqE0fN/7hUuAKGLpZN7MONWxuXyCkl3A+DGa4da4vO 4phS9HJZDG1r+1AelG+5Kat3YB7HwLdJ/kN2V+rX/XeISGxoQ55C1OrDwAZcU45N4faN Ofg5LqZdLTdp2Bq6bCkRiKuvVa8AspcpuxaMJxC7fA6vILb/TwFa+C8uSPilDAs4ZrLf XDUkKZASKqozqFlCBM05i93x0wCQH4JpRoYY7cBeWcxbDWjFkTblg6pdZ/OINrwGDxsD R5WYpAFkcFy5HFfVjvPpAds2IHhtrQdflOr4WMgCpsB9WfVvxfWaTUzz+CP3xxXwXv45 xeLw== X-Gm-Message-State: AMCzsaWnQwKPjv6JEORXJmAiupaJAaZPYkDLrzfNLiG22fLJd9GpnXea wkT5y0WLbQoC1eSbkP4/Y5oRt/l/SVY= X-Google-Smtp-Source: ABhQp+RrCEiyPoEWwVwuE+uhA2sk5tDZ8AdoYHHr0unRouginRdhujBlUmITk/8ZcII0gxB/IfSFeg== X-Received: by 10.99.106.71 with SMTP id f68mr1535160pgc.449.1508926065976; Wed, 25 Oct 2017 03:07:45 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id c185sm4623431pfb.112.2017.10.25.03.07.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 03:07:44 -0700 (PDT) Date: Wed, 25 Oct 2017 03:07:43 -0700 From: Kees Cook To: "Martin K. Petersen" Cc: QLogic-Storage-Upstream@qlogic.com, "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: qla4xxx: Convert timers to use timer_setup() Message-ID: <20171025100743.GA145111@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Martin K. Petersen Acked-by: Manish Rangankar --- 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);