From patchwork Tue Oct 31 19:13:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10035241 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 AC284602B9 for ; Tue, 31 Oct 2017 19:14:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E3F628AF4 for ; Tue, 31 Oct 2017 19:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932E028AF6; Tue, 31 Oct 2017 19:14:54 +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 70F4328AF4 for ; Tue, 31 Oct 2017 19:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932989AbdJaTOx (ORCPT ); Tue, 31 Oct 2017 15:14:53 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:50957 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932684AbdJaTOA (ORCPT ); Tue, 31 Oct 2017 15:14:00 -0400 Received: by mail-pg0-f65.google.com with SMTP id y5so28579pgq.7 for ; Tue, 31 Oct 2017 12:14:00 -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=I4XMWhLi/jL/OWgXH1fDEd2tr/dDkujaYnO9o9hOwMw=; b=EwAVkppGrlSi2YKy4zl1njxPkpQAi4jj+V+qokVS4fQbeE4sCS/sJaUQ97x7cBaDwb rCKusgcY2wKQrDofjLSi13tLsjK6uQRPx/UjDFP0MZVaqIkV2g+6pLcaDto83b+Kau2S Im4BdGGPvVumh2+1vN3LM14O218ll33soRhww= 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=I4XMWhLi/jL/OWgXH1fDEd2tr/dDkujaYnO9o9hOwMw=; b=QGDkpcGV0YiX93L9t3mhLcQdkSJHnWZVWp4FwSUKVo2EfgStF7gyAPKS6QBSu8dD9R Wz9G/xc6qP6AGeRo+prX+jV9EihW7PUYfuPHmbhi+AYytnC+bXvJho5Ylgxwa+jHuynH gC63rhG0yXqQuLI1YLOf8IiLIpPnlFS0qsy9yboqMQKYnH6wHs0ANRminu8FKAWQ+oe3 5b/aEgJD/Q8J5UpVGrL4bohCWpj6AEEQIrGrKIxvj5tF1klop/M50+aDU/8SiQ8kXoaL PQdUWLic3iRNgZJ8kaTkE9saemOaav58tFt0zylCVoq16eN5/zE/+dabIvmR6QOJnBDf CtBg== X-Gm-Message-State: AMCzsaVNGDcfUtHV4s8+aY9ufP+DQmnzr3K9kTkHQjz1civrYOsOJmT6 9LF9Zoo41FMSqNK3IvmAlfcv+w== X-Google-Smtp-Source: ABhQp+QvPBxsJO+ARSOT9+5nP9MFGtHvs/WUtfTgqtFH3dLA8bb5GyoQ+h/v1Jka3JMmQmO6V7asnA== X-Received: by 10.99.55.77 with SMTP id g13mr2799750pgn.209.1509477240086; Tue, 31 Oct 2017 12:14:00 -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 z7sm3502607pgp.36.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 3/4] scsi: qla2xxx: Convert qla2x00_timer() to use timer_setup() Date: Tue, 31 Oct 2017 12:13:48 -0700 Message-Id: <1509477229-62141-4-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, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly for the qla2x00_timer() callback and associated timer. 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_os.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 541a087cdb45..ab5b88203886 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -206,7 +206,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_timer(struct timer_list *); 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 *); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 7e7e5d095c26..f97e585dee77 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -332,8 +332,7 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL; __inline__ void qla2x00_start_timer(scsi_qla_host_t *vha, unsigned long interval) { - setup_timer(&vha->timer, (void (*)(unsigned long))qla2x00_timer, - (unsigned long)vha); + timer_setup(&vha->timer, qla2x00_timer, 0); vha->timer.expires = jiffies + interval * HZ; add_timer(&vha->timer); vha->timer_active = 1; @@ -5994,8 +5993,9 @@ qla2x00_rst_aen(scsi_qla_host_t *vha) * Context: Interrupt ***************************************************************************/ void -qla2x00_timer(scsi_qla_host_t *vha) +qla2x00_timer(struct timer_list *t) { + scsi_qla_host_t *vha = from_timer(vha, t, timer); unsigned long cpu_flags = 0; int start_dpc = 0; int index;