From patchwork Mon Oct 16 23:54:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010287 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 77B59600CC for ; Mon, 16 Oct 2017 23:55:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 698ED28714 for ; Mon, 16 Oct 2017 23:55:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EA7428716; Mon, 16 Oct 2017 23:55:39 +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 DC73828714 for ; Mon, 16 Oct 2017 23:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933061AbdJPXyl (ORCPT ); Mon, 16 Oct 2017 19:54:41 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:47085 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933053AbdJPXyk (ORCPT ); Mon, 16 Oct 2017 19:54:40 -0400 Received: by mail-pg0-f46.google.com with SMTP id k7so8087135pga.3 for ; Mon, 16 Oct 2017 16:54:40 -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=5CkYlQ7a6niLBq4CBDE4GMo9+Zx9G6gCm11CxmnBSK4=; b=DGI3pKREfnwyYzO+EnHD2NurZBXyWDn3Py1nHcG3TC1DT9uf5279Mneic0owFHw2zL ns08J3MHAky4nx/z143WsvkWNpjUxjrPF8KovpceOdbJfFNn0z0H67lNKjPpqV2qdQLl c3O/W2oPJKDQf6htArlUfWsS6Vb+L9pWNldog= 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=5CkYlQ7a6niLBq4CBDE4GMo9+Zx9G6gCm11CxmnBSK4=; b=PfH9tTz2HIs0eBUXe9YKvu+ZLbRqylV1+00eT1toQvfs0oMzR3HRkfeKJBuAkivfjT vr+VM/J1opho94X6FGO5Kio5aYsPThGWVKFB0hji2yHLb/HteTROIzM/Mj4MN8LKkgYL HbyWtyUlEarOGMTB7HUPm5Zgnmrrrd4gUxcnTAeI0JiCo7qRdQUGWZ3kEamL1WI5zaHj gjRBQP50kAyKYzBvmMl68qV/PIWVnOZbXvZjQBjBpmkS4IGsTuk+hono1GVc4QBZESu2 z1b0QLfKpAkqa1txqi8NYwjvP6wbHPrYgKQ6ZGrGpGS2GWB40aV99ku7iCOfalN7l/uK R0OQ== X-Gm-Message-State: AMCzsaVS6cKskv6SFTvPfxzYuyOM5WxPCaVaZuPODvpcdruoS63IYJGA qwdc2S/3qbQDmxAjLOGP1C9miQ== X-Google-Smtp-Source: AOwi7QDUjB8RIJKaY7C6ZGB4Mivoqg6NlgZZU8UpEdnQZlal6DLi/weSJrsEQRdEr3v4GEzzAFA/ew== X-Received: by 10.101.82.69 with SMTP id q5mr9429546pgp.140.1508198079800; Mon, 16 Oct 2017 16:54:39 -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 l12sm14658408pgr.10.2017.10.16.16.54.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:54:38 -0700 (PDT) Date: Mon, 16 Oct 2017 16:54:37 -0700 From: Kees Cook To: "Martin K. Petersen" Cc: Don Brace , "James E.J. Bottomley" , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: smartpqi: Convert timers to use timer_setup() Message-ID: <20171016235437.GA102564@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: "Martin K. Petersen" Cc: Don Brace Cc: "James E.J. Bottomley" Cc: esc.storagedev@microsemi.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Martin K. Petersen --- drivers/scsi/smartpqi/smartpqi_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 8fe918398336..b2880c7709e6 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -2860,11 +2860,12 @@ static void pqi_event_worker(struct work_struct *work) #define PQI_HEARTBEAT_TIMER_INTERVAL (10 * HZ) -static void pqi_heartbeat_timer_handler(unsigned long data) +static void pqi_heartbeat_timer_handler(struct timer_list *t) { int num_interrupts; u32 heartbeat_count; - struct pqi_ctrl_info *ctrl_info = (struct pqi_ctrl_info *)data; + struct pqi_ctrl_info *ctrl_info = from_timer(ctrl_info, t, + heartbeat_timer); pqi_check_ctrl_health(ctrl_info); if (pqi_ctrl_offline(ctrl_info)) @@ -2902,8 +2903,6 @@ static void pqi_start_heartbeat_timer(struct pqi_ctrl_info *ctrl_info) ctrl_info->heartbeat_timer.expires = jiffies + PQI_HEARTBEAT_TIMER_INTERVAL; - ctrl_info->heartbeat_timer.data = (unsigned long)ctrl_info; - ctrl_info->heartbeat_timer.function = pqi_heartbeat_timer_handler; add_timer(&ctrl_info->heartbeat_timer); } @@ -6465,7 +6464,7 @@ static struct pqi_ctrl_info *pqi_alloc_ctrl_info(int numa_node) INIT_DELAYED_WORK(&ctrl_info->rescan_work, pqi_rescan_worker); INIT_DELAYED_WORK(&ctrl_info->update_time_work, pqi_update_time_worker); - init_timer(&ctrl_info->heartbeat_timer); + timer_setup(&ctrl_info->heartbeat_timer, pqi_heartbeat_timer_handler, 0); INIT_WORK(&ctrl_info->ctrl_offline_work, pqi_ctrl_offline_worker); sema_init(&ctrl_info->sync_request_sem,