From patchwork Tue Oct 31 19:13:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10035247 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 D8451602B9 for ; Tue, 31 Oct 2017 19:15:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CABFB28AF6 for ; Tue, 31 Oct 2017 19:15:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF7EC28AFC; Tue, 31 Oct 2017 19:15:38 +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=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 5279728AF6 for ; Tue, 31 Oct 2017 19:15:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933043AbdJaTPY (ORCPT ); Tue, 31 Oct 2017 15:15:24 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:53333 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753885AbdJaTN7 (ORCPT ); Tue, 31 Oct 2017 15:13:59 -0400 Received: by mail-pg0-f65.google.com with SMTP id s2so21341pge.10 for ; Tue, 31 Oct 2017 12:13:59 -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=KBzlKwUx5baZtNFd1Bm3caXX5rBYIVAYWa1eabcv4Qo=; b=oDR1okjlPY4lem3lL4NcF2rs/zyKcuDbsQOvBA+ypQqJs16dB4T7f3mjo6khGepLWb NQEFDmEFUuaek3g9JlkLyArIkTa2OkaNIYjUrcyZTBbbtDHkO8hlMg5QqAK1PhAdWrFg yeWTo0cDFrfojzifjA7mS9NbYZxgRGQuCyHqE= 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=KBzlKwUx5baZtNFd1Bm3caXX5rBYIVAYWa1eabcv4Qo=; b=pr8vTcYxHA6Ob9Yg6KPaWC47qQz8/lCWo2EFmv8RVt+qUuRLqe+N6q62078kNJ/iZ7 LNqKVoWvHoN4eB6ac3NBhzsVCppApwNWPBAb49zdvw6fNOdITdZMrb4SoT5rzQ5hP4vU p12mUWyKo8f3AgOV4UWn28UJCm+bmcULVZ4CzDV2ZjqGoUS0bpgdEUNeIhxA2st2jv14 BWprgO/sZPCyik4PdDcfQvls+u+DkQ9mt1QoUiN3EdYpl4IxwMIB5bGntBzEtXSqRUPn P4Jw0EMRktylFq4nOzVc4P5jJCcNnm7PXYh88tm4l4o64vA8bPK7SUbmP+TXaiE5/oQ1 sNuw== X-Gm-Message-State: AMCzsaWqodSw94uPnbtAJm4eKt+3FqTfuqT0IEUJH3XzJt0bqNP62kix Fb9wVAxDDlRlICx332ngHgkxTA== X-Google-Smtp-Source: ABhQp+SpVicroaNulhTZ4hsFZJeNROYqz+P654RW0ldpL4XHU8cK08lH21JI2EhvVxiPtB5PfMM9sw== X-Received: by 10.98.70.6 with SMTP id t6mr3114174pfa.257.1509477239366; Tue, 31 Oct 2017 12:13:59 -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 e84sm4667452pfd.1.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 4/4] scsi: qla2xxx: Convert qla2x00_sp_timeout() to use timer_setup() Date: Tue, 31 Oct 2017 12:13:49 -0700 Message-Id: <1509477229-62141-5-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_sp_timeout() 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_init.c | 4 ++-- drivers/scsi/qla2xxx/qla_inline.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index ab5b88203886..3ad375f85b59 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -753,7 +753,7 @@ extern int qla82xx_restart_isp(scsi_qla_host_t *); /* IOCB related functions */ extern int qla82xx_start_scsi(srb_t *); extern void qla2x00_sp_free(void *); -extern void qla2x00_sp_timeout(unsigned long); +extern void qla2x00_sp_timeout(struct timer_list *); extern void qla2x00_bsg_job_done(void *, int); extern void qla2x00_bsg_sp_free(void *); extern void qla2x00_start_iocbs(struct scsi_qla_host *, struct req_que *); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b5b48ddca962..44cf875a484a 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -45,9 +45,9 @@ static void qla24xx_handle_prli_done_event(struct scsi_qla_host *, /* SRB Extensions ---------------------------------------------------------- */ void -qla2x00_sp_timeout(unsigned long __data) +qla2x00_sp_timeout(struct timer_list *t) { - srb_t *sp = (srb_t *)__data; + srb_t *sp = from_timer(sp, t, u.iocb_cmd.timer); struct srb_iocb *iocb; scsi_qla_host_t *vha = sp->vha; struct req_que *req; diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h index 34cdb5d9c87c..17d2c20f1f75 100644 --- a/drivers/scsi/qla2xxx/qla_inline.h +++ b/drivers/scsi/qla2xxx/qla_inline.h @@ -269,8 +269,7 @@ qla2x00_rel_sp(srb_t *sp) static inline void qla2x00_init_timer(srb_t *sp, unsigned long tmo) { - setup_timer(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, - (unsigned long)sp); + timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; add_timer(&sp->u.iocb_cmd.timer); sp->free = qla2x00_sp_free;