From patchwork Wed Oct 25 10:21:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10026447 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 7240E6032C for ; Wed, 25 Oct 2017 10:21:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D7AC1FF3E for ; Wed, 25 Oct 2017 10:21:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51F2227DCD; Wed, 25 Oct 2017 10:21: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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 D026C1FF3E for ; Wed, 25 Oct 2017 10:21:53 +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=LI9dBpzHX/VDZ+EsDZfa8v8iS5O/sSkn5Jhg3qfMx+U=; b=c7KLx469JJ7iEo GD4JL1kEdb+IAtY1h17APw8ypCM8Nxh5kKnvP4dhjdZk5mLjM0DnhCPHwSgJvvgsxG3CQ2fQHs4C4 wlfD7cyByjwCioldViUKTnzAThMP9IDhLCo3abV/FUHJMGStvnkrmHrDorrqDIY4eudjiY72InKto iK1a0cx2oe/XQ7eV5rJ9eK49TT2Eg2UrgLwMU0Rcku9unDFU83fRpG+fz2eAa9c9ZHGKl3g91+/df sFYUhLd3aamJb0BWXX+Y/B76XAxgW8vZP7axvyBzp4AOyYsHKtXACgnRUYdLmLbvzh01tLLndsO8b +xb9bxzG/t1vSBEbLLFA==; 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 1e7Ion-0001uU-Ar; Wed, 25 Oct 2017 10:21:49 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e7Iok-0001sU-Fd for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2017 10:21:48 +0000 Received: by mail-pg0-x242.google.com with SMTP id r25so16952449pgn.4 for ; Wed, 25 Oct 2017 03:21:26 -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=XUIPAql9YqgfbHmVGtEvwLw/mjf0FQxrwgLQsS1G/a8=; b=OxR+eObVBSdg7Nh9fReSn+kOv3MR4NHC5dVMp4gpWRR9FFz7P0cXNyxMqvXJoE7tDI pX5HfzZoZQnYf4qsEXiK2zPAjroyOv4fzL3SsNX+NfW4MZqZ2+vSNbeaQWnxs+zpVa1a R1kfFtR354CHKPz5AZRgXqvv0xFfTGO6JHp1M= 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=XUIPAql9YqgfbHmVGtEvwLw/mjf0FQxrwgLQsS1G/a8=; b=NpcnYLCcmm2VABRJmz2Pkqgz0NdrkU5IPPt8C20ChdEOhi3wN7GI49bJAPfXH+viG6 Edw2F9ycFs8Z5pWrBlZEvBx8pPTNeBe45CErMuj25ZnIfAfgU3MAHYm11dxjdx25CrZh gQJ22EjD99+mrmn7MAXmBAge1U+hzoXhy/DZDivwZE9QEOXbpHqbJagAWOCYzz7jmLpH nCaSsugYqN42Lg88Y0UBX24q/XHd+vJS+W8xbSq52nWGYU96ovxVVQXM2nZuQz9Bkke7 llBlJgtTnph+VB6M2i12J4Ws/p09e9KYrwYIRwYLxA5wapAHRj5KXHiJt4nckAQMQr0T kBVw== X-Gm-Message-State: AMCzsaVVx4BESdSnN7tXPgLMwu0nj9IhD+Ghpl83zWeeGSGUx9pmc8I5 Jz0SiTFKs/Xvp2jEPJK+HJazxA== X-Google-Smtp-Source: ABhQp+RM8qDrVNXAQOFbCJ8XO+6GZQhzRp5Bery/XwVrC7NH3+NQxj08/71g1/NLO3eE6Fp89hWyrg== X-Received: by 10.98.198.138 with SMTP id x10mr1772550pfk.55.1508926886044; Wed, 25 Oct 2017 03:21:26 -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 g207sm4600343pfb.101.2017.10.25.03.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 03:21:24 -0700 (PDT) Date: Wed, 25 Oct 2017 03:21:24 -0700 From: Kees Cook To: Russell King Subject: [PATCH] ARM: footbridge: Convert timers to use timer_setup() Message-ID: <20171025102124.GA145647@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171025_032146_552473_05E061B5 X-CRM114-Status: GOOD ( 12.87 ) 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-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook --- arch/arm/mach-footbridge/dc21285.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 96a3d73ef4bf..8407e4a07c77 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c @@ -136,19 +136,14 @@ struct pci_ops dc21285_ops = { static struct timer_list serr_timer; static struct timer_list perr_timer; -static void dc21285_enable_error(unsigned long __data) +static void dc21285_enable_error(struct timer_list *timer) { - switch (__data) { - case IRQ_PCI_SERR: - del_timer(&serr_timer); - break; - - case IRQ_PCI_PERR: - del_timer(&perr_timer); - break; - } + del_timer(timer); - enable_irq(__data); + if (timer == &serr_timer) + enable_irq(IRQ_PCI_SERR) + else if (timer == &perr_timer) + enable_irq(IRQ_PCI_PERR); } /* @@ -323,13 +318,8 @@ void __init dc21285_preinit(void) *CSR_PCICMD = (*CSR_PCICMD & 0xffff) | PCICMD_ERROR_BITS; } - init_timer(&serr_timer); - init_timer(&perr_timer); - - serr_timer.data = IRQ_PCI_SERR; - serr_timer.function = dc21285_enable_error; - perr_timer.data = IRQ_PCI_PERR; - perr_timer.function = dc21285_enable_error; + timer_setup(&serr_timer, dc21285_enable_error, 0); + timer_setup(&perr_timer, dc21285_enable_error, 0); /* * We don't care if these fail.