From patchwork Tue Oct 31 19:13:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10035235 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 978E6602B9 for ; Tue, 31 Oct 2017 19:14:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A3C328AEA for ; Tue, 31 Oct 2017 19:14:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EDEB28AED; Tue, 31 Oct 2017 19:14:16 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham 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 EB7BC28AEA for ; Tue, 31 Oct 2017 19:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932892AbdJaTOF (ORCPT ); Tue, 31 Oct 2017 15:14:05 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43779 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbdJaTOB (ORCPT ); Tue, 31 Oct 2017 15:14:01 -0400 Received: by mail-pf0-f193.google.com with SMTP id a8so35414pfc.0 for ; Tue, 31 Oct 2017 12:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hC2Td8UMfDmXMCp/u//Zl90KH83lU9BpG71qKtPZYtg=; b=fohsyoSj9A9XXd7iiKlmLZLGIs1OMfDQPDpk2365aPBx58nFCjT4RItgM5L4Rp714M EnKuLCqvaKAEdJ3VtJsrs/R8AzwiEmUn4DJzEHxOqSfXAubPe0a0fxr9cXhYxc4HvuF9 8RtAFbdSh77ioGrsvBFWxe//CFrrj0H80dOlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hC2Td8UMfDmXMCp/u//Zl90KH83lU9BpG71qKtPZYtg=; b=UjQamsMk64ZXEcYYEgR29QBLMryX7tUSSIS1D1fqKELpoyWKQIXUlBVc/AXSOOm3o3 gbcsfem3O9dgeulXlhY8fW1GdMzl6JuQomxoOneQTxdmVNn4e9d056/1Luz5zU0PnFCt kZwV+bJAlgLCHpI1Qz23ST27LZEW+a/YqbVrI8FCqBsKn+dJYvR7kRg1ODAvITVd9R++ LZLKSS3ckEishRbjb45/nY6jY2AHZqzf88+ybqcYwUvAP5jStbo/E79x0BkvUnrWBNJ8 kma7t8BWvc1BLKS57nd/kOdcvdvO/ir6Ecd0a9V0YjsAuaUk0kBE043UXNtb9RTencj5 /fTA== X-Gm-Message-State: AMCzsaU58EdYoETaWxmNDeg4wer+IxiEj3KUKEQhyCYKjeMyENXh/kE1 suFDr7LhTfx2xkkWXFZ/urxLaw== X-Google-Smtp-Source: ABhQp+TeXkb5o3OUf9Bo4I77EWGX5C7AiBw9sS9N7QPXLdyQNfDdQQ5qQhx6UcqFojjY7g8WA1UxPw== X-Received: by 10.98.37.68 with SMTP id l65mr3100365pfl.253.1509477241056; Tue, 31 Oct 2017 12:14:01 -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 q13sm3785334pgt.73.2017.10.31.12.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 12:13:57 -0700 (PDT) From: Kees Cook To: Himanshu Madhani Cc: Kees Cook , Bart Van Assche , "Martin K. Petersen" , qla2xxx-upstream@qlogic.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] scsi: qla2xxx: Refactor qla2x00_start_timer() Date: Tue, 31 Oct 2017 12:13:47 -0700 Message-Id: <1509477229-62141-3-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509477229-62141-1-git-send-email-keescook@chromium.org> References: <1509477229-62141-1-git-send-email-keescook@chromium.org> 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, this refactors qla2x00_start_timer() to not pass a callback argument, since all callers use the same callback. Cc: Himanshu Madhani Cc: Bart Van Assche Cc: "Martin K. Petersen" Cc: qla2xxx-upstream@qlogic.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook --- drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_mid.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index f852ca60c49f..541a087cdb45 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -207,7 +207,7 @@ int qla24xx_async_abort_cmd(srb_t *); extern struct scsi_host_template qla2xxx_driver_template; extern struct scsi_transport_template *qla2xxx_transport_vport_template; extern void qla2x00_timer(scsi_qla_host_t *); -extern void qla2x00_start_timer(scsi_qla_host_t *, void *, unsigned long); +extern void qla2x00_start_timer(scsi_qla_host_t *, unsigned long); extern void qla24xx_deallocate_vp_id(scsi_qla_host_t *); extern int qla24xx_disable_vp (scsi_qla_host_t *); extern int qla24xx_enable_vp (scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index c0f8f6c17b79..cbf544dbf883 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -487,7 +487,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); - qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL); + qla2x00_start_timer(vha, WATCH_INTERVAL); vha->req = base_vha->req; host->can_queue = base_vha->req->length + 128; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 6c10a7b970c0..7e7e5d095c26 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -330,9 +330,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) +qla2x00_start_timer(scsi_qla_host_t *vha, unsigned long interval) { - setup_timer(&vha->timer, (void (*)(unsigned long))func, + setup_timer(&vha->timer, (void (*)(unsigned long))qla2x00_timer, (unsigned long)vha); vha->timer.expires = jiffies + interval * HZ; add_timer(&vha->timer); @@ -3245,7 +3245,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) base_vha->host->irq = ha->pdev->irq; /* Initialized the timer */ - qla2x00_start_timer(base_vha, qla2x00_timer, WATCH_INTERVAL); + qla2x00_start_timer(base_vha, WATCH_INTERVAL); ql_dbg(ql_dbg_init, base_vha, 0x00ef, "Started qla2x00_timer with " "interval=%d.\n", WATCH_INTERVAL);