From patchwork Mon Oct 16 23:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010263 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 32A2360230 for ; Mon, 16 Oct 2017 23:49:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2203627FAE for ; Mon, 16 Oct 2017 23:49:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 163542810E; Mon, 16 Oct 2017 23:49:21 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable 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 AAEC027FAE for ; Mon, 16 Oct 2017 23:49:20 +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=GHBCQYV9ZUyZ95nGUkK0pcCGfV4UixDJyGJNToH1XRg=; b=HazhFe2+Tqw/EG QZd+fsdl4V3VTSYIIi2lxA+KaDG6s4qMPt3NfBv7lQXHgoIdUOUctp+ut5uJa8zbvvD45dxgeSw68 XE8Lfkeb+t6K+lc1SYFhihI8bXqTkjkTi7nyp2ZmwuBE1iO6PcvmET5BsBgKuhohPx2PDF48vLwhF YuoH9r0LMC3aDH9fc6pKhRzqP6/KW/7YMu4opm3oBRqYVVfCiQlfxt+ViN26rOJehhsP/nTtGVAEq BHSlhA79BJnqIUL3HAwjnuGRalacnoRljOxHZXBkKhGh4HauV55uh9tBAGbC21A8hF3tdE5GFTPFK fyjpOd/O+dURwzyLE4Yw==; 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 1e4F8J-0001v5-KY; Mon, 16 Oct 2017 23:49:19 +0000 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e4F8F-0001t5-Ly for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2017 23:49:17 +0000 Received: by mail-pf0-x235.google.com with SMTP id n89so9322735pfk.11 for ; Mon, 16 Oct 2017 16:48:55 -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=z/FOaTa+BKGBRqduR0bTRuNXQXqLOwwAcAftzFvxvjE=; b=enazXjNWwQouMr/scSWSd7LLiic4bj/e8seZSkgak4CJYTgfT32hEaHwMuHZjfqFj3 ZD7T5xW+R5DlCL3GnL+ir4vTzoSjK8JX50sOrYGgkx4DRuJXKWidoQD4tWr53tKajkSc ihF2amZFE3WZLRg3qqV0PD1F0jcJj9WzB/ewo= 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=z/FOaTa+BKGBRqduR0bTRuNXQXqLOwwAcAftzFvxvjE=; b=ZY/UKFCFg/bO3mT/jL1V7DLHVAmAIREqb2R6TCiEJ+WfLxzh1w5sE+YJ7iscIqU1eQ DQ3orwzRAau1pH7MsP/8bN6A0bWn+r5dkX7qs5wwuyifLiWSLtwu8Ltu0BCp+z/ncqX6 HgneRuOUZ77kUt4AyZs7rzelfvNn4aPj1jApkTybUsv/Kgo10sURW6iJXYKsOA1coa32 G7g6FCnohQdyRapUTpn3AQtHlCF5I6rLPftVqkeAXPGMcII72kdEYXJ833osdBNaFiW7 xHSAv+9iH8AH3gesQPI3xVT6tazYW+verBS1SIt+aIc5xoom89zgjLezKOyOF4Gv2xUR fafQ== X-Gm-Message-State: AMCzsaXpWbjp/2hB/iqJnJztyukcYFuoFUMtqXiIMIVqU8P5HXpcsYPD CG7abWCD4DHIKLLpi4fb4INv6Q== X-Google-Smtp-Source: ABhQp+QBvKxNh4iBUaqTVEeH/XiumQcTrvFjCvhiBVBmb4LgLdtZj+bHGocbinD8EVcsOYhtwEdQ8g== X-Received: by 10.101.88.14 with SMTP id g14mr5380143pgr.198.1508197734589; Mon, 16 Oct 2017 16:48:54 -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 b28sm17634949pfl.86.2017.10.16.16.48.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:48:53 -0700 (PDT) Date: Mon, 16 Oct 2017 16:48:52 -0700 From: Kees Cook To: Robert Jarzmik Subject: [PATCH] arm: pxa: Convert timers to use timer_setup() Message-ID: <20171016234852.GA102339@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_164915_777068_3B019298 X-CRM114-Status: GOOD ( 14.54 ) 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-kernel@vger.kernel.org, Haojian Zhuang , Daniel Mack , Russell King 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. Adds a static variable to hold the interrupt private data pointer. Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/mach-pxa/lubbock.c | 15 ++++++--------- arch/arm/mach-pxa/sharpsl_pm.c | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index d6159f8ef0c2..df45682e99a5 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -381,14 +381,11 @@ static struct pxafb_mach_info sharp_lm8v31 = { #define MMC_POLL_RATE msecs_to_jiffies(1000) -static void lubbock_mmc_poll(unsigned long); static irq_handler_t mmc_detect_int; +static void *mmc_detect_int_data; +static struct timer_list mmc_timer; -static struct timer_list mmc_timer = { - .function = lubbock_mmc_poll, -}; - -static void lubbock_mmc_poll(unsigned long data) +static void lubbock_mmc_poll(struct timer_list *unused) { unsigned long flags; @@ -401,7 +398,7 @@ static void lubbock_mmc_poll(unsigned long data) if (LUB_IRQ_SET_CLR & (1 << 0)) mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE); else { - (void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data); + (void) mmc_detect_int(LUBBOCK_SD_IRQ, mmc_detect_int_data); enable_irq(LUBBOCK_SD_IRQ); } } @@ -421,8 +418,8 @@ static int lubbock_mci_init(struct device *dev, { /* detect card insert/eject */ mmc_detect_int = detect_int; - init_timer(&mmc_timer); - mmc_timer.data = (unsigned long) data; + mmc_detect_int_data = data; + timer_setup(&mmc_timer, lubbock_mmc_poll, 0); return request_irq(LUBBOCK_SD_IRQ, lubbock_detect_int, 0, "lubbock-sd-detect", data); } diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 249b7bd5fbc4..398ba9ba2632 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -341,7 +341,7 @@ static void sharpsl_charge_toggle(struct work_struct *private_) sharpsl_pm.charge_start_time = jiffies; } -static void sharpsl_ac_timer(unsigned long data) +static void sharpsl_ac_timer(struct timer_list *unused) { int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); @@ -366,7 +366,7 @@ static irqreturn_t sharpsl_ac_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static void sharpsl_chrg_full_timer(unsigned long data) +static void sharpsl_chrg_full_timer(struct timer_list *unused) { dev_dbg(sharpsl_pm.dev, "Charge Full at time: %lx\n", jiffies); @@ -841,9 +841,9 @@ static int sharpsl_pm_probe(struct platform_device *pdev) sharpsl_pm.charge_mode = CHRG_OFF; sharpsl_pm.flags = 0; - setup_timer(&sharpsl_pm.ac_timer, sharpsl_ac_timer, 0UL); + timer_setup(&sharpsl_pm.ac_timer, sharpsl_ac_timer, 0); - setup_timer(&sharpsl_pm.chrg_full_timer, sharpsl_chrg_full_timer, 0UL); + timer_setup(&sharpsl_pm.chrg_full_timer, sharpsl_chrg_full_timer, 0); led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);