From patchwork Mon Oct 16 23:20:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010113 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 0BB0460235 for ; Mon, 16 Oct 2017 23:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE86028676 for ; Mon, 16 Oct 2017 23:20:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C70286EF; Mon, 16 Oct 2017 23:20:41 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED,URIBL_SBL autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6ED8D28676 for ; Mon, 16 Oct 2017 23:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dm8WjMwzC+QtDzONUQW3s9B4u151P0eoBxIWb7brTQQ=; b=Qrtq7lccgHdzM3 RUkMQbJh9TB9pqJgIGbyInOf5JxvJ6qoGFZLedmA2RXmxR9sebASSPO9b/IUpXdZDi9RuTewttMnJ UukccTk+k1S7AKeKLUQDd051vaPCifsuBjeJvdL/qRrBuf3H1fVjdJlxfQiDk/CLk/YMnbmiDEtF9 AZa3PHagRmf0CjuYucXxqXSbxipFHGJMiV/Y1SGxVKFddiI1Rb9G7D/VtieBrpSCA3BjW2omeJzrZ H+8rEqt3IOXGaqDIP3tt4aIis1b7awSOpIYbK/BxUXfqH7z90M905Hh1MjfjYkrYIjNmLyxUgeLWV HjMn6as16yTX8l5G4OLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e4EgU-00050n-Tw; Mon, 16 Oct 2017 23:20:34 +0000 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e4EgR-0004yw-Ba for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2017 23:20:33 +0000 Received: by mail-pf0-x22c.google.com with SMTP id d28so16929789pfe.2 for ; Mon, 16 Oct 2017 16:20:09 -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=Gj0SvLJ+GdJcSYGCb6FFoq1/7Qbp00IQkRD2l19WyAg=; b=Iot419DPEHO90YEDNvKzufM52G3njhcjBR+okNIsjUGs2tb98tqVCxz6KH1HxuRgvx F7kQjrgfBnh6L3nVTYbTO0YZ8sDQD+Feab1/MFvrFLZSQaZNh5xX1TN6evxXbIIrzBs8 Zq9x7mVuF67lk9lU2lCZjMZPZp5dcgX/PqnT8= 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=Gj0SvLJ+GdJcSYGCb6FFoq1/7Qbp00IQkRD2l19WyAg=; b=AozzeKhC4XKpeEWacfXOEMPedEzYJpSnEAcp3eQCnoJM8a11ButpYItH9RsPOysrOM guTjQm7XA0gHFS4XLwoWF1OXmgJcbfmUWwVJGtz4mFJt18PMjSouivjNNVBaXyWk2G7d STFA3EvdzjhKZtkLAdpse4Zco1AKN9xs6e+/ars75d+JY72Q8y6red5HIVRFTC2U8sNU jMwv0fxgsBBX2q3DV0NRuG8xZYfxwmgoyMkJeDP7Gz9eSyDNM14L+WdwoAUV6AGBSPS/ DDCl/OIdAr9s910XiuyzCyKUoyqsWg5rtKmaQeeomLOJixi1CkbGsOKVHzFFT4EzDhKd mnMQ== X-Gm-Message-State: AMCzsaVw0+WGNI8+3v+NDT+ORcq+bqj+nYd47j8nKgOTfFfP0sUQrm0Q bdx6vUhjZW6n+glADFagh1QC7A== X-Google-Smtp-Source: AOwi7QCGyeFIZNQnhJGMl3832DPSyJ5m5fXwwcvIVtbBKRZc5zP83jYJgzIllyaKSYG4jXyUuAtK1g== X-Received: by 10.159.195.12 with SMTP id bd12mr10120060plb.51.1508196009409; Mon, 16 Oct 2017 16:20:09 -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 s71sm10191436pfa.147.2017.10.16.16.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:20:08 -0700 (PDT) Date: Mon, 16 Oct 2017 16:20:07 -0700 From: Kees Cook To: Wim Van Sebroeck Subject: [PATCH] watchdog: lpc18xx_wdt: Convert timers to use timer_setup() Message-ID: <20171016232007.GA100300@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171016_162031_435890_FFE27A85 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Guenter Roeck , linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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: Wim Van Sebroeck Cc: Guenter Roeck Cc: linux-watchdog@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Acked-by: Guenter Roeck --- drivers/watchdog/lpc18xx_wdt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c index 3b8bb59adf02..b4221f43cd94 100644 --- a/drivers/watchdog/lpc18xx_wdt.c +++ b/drivers/watchdog/lpc18xx_wdt.c @@ -78,10 +78,10 @@ static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev) return 0; } -static void lpc18xx_wdt_timer_feed(unsigned long data) +static void lpc18xx_wdt_timer_feed(struct timer_list *t) { - struct watchdog_device *wdt_dev = (struct watchdog_device *)data; - struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); + struct lpc18xx_wdt_dev *lpc18xx_wdt = from_timer(lpc18xx_wdt, t, timer); + struct watchdog_device *wdt_dev = &lpc18xx_wdt->wdt_dev; lpc18xx_wdt_feed(wdt_dev); @@ -96,7 +96,9 @@ static void lpc18xx_wdt_timer_feed(unsigned long data) */ static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev) { - lpc18xx_wdt_timer_feed((unsigned long)wdt_dev); + struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); + + lpc18xx_wdt_timer_feed(&lpc18xx_wdt->timer); return 0; } @@ -267,8 +269,7 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev) __lpc18xx_wdt_set_timeout(lpc18xx_wdt); - setup_timer(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, - (unsigned long)&lpc18xx_wdt->wdt_dev); + timer_setup(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 0); watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout); watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128);