From patchwork Tue Oct 24 10:13:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10024053 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 DED1E60245 for ; Tue, 24 Oct 2017 10:13:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C457B289ED for ; Tue, 24 Oct 2017 10:13:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8CB5289EF; Tue, 24 Oct 2017 10:13:58 +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 36032289ED for ; Tue, 24 Oct 2017 10:13:58 +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=buEkB/DLvkUD/66h8o4cIreOvxWb5qfWzLg1cejj2dg=; b=CX08Nh0TOUTzoq EO3F63PAWmEsWZ+RlzGJgxASY2w1Cfx+8z7iYQ7qY51jDssVsZgxG2tRX0pqxSRcL9lng7XlZ7ekj ejMd8EHaFxCzHofoX6a+ChUrIlo+HLdv/h890znvD5tV95DFOUousCN5wEelP+qW/aMEAdSv+hIDC slh+CuL1a8G3GzjbhNGrlnY2b/kWxekvZVI96xOI3fCFtnUKIYlMb78AslN1CEfKs8Hled3ThWQOE oMpubswp3F+naG8Z/65dU3k8rAkwASPPWk8RqeuVFpbsQB2wec0BW0b9tMAx5qoGiMYo2WEXz03DB e7lLJsTAkUIiQQJ2W9hg==; 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 1e6wDd-0002oT-PI; Tue, 24 Oct 2017 10:13:57 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e6wDa-0002lF-4b for linux-arm-kernel@lists.infradead.org; Tue, 24 Oct 2017 10:13:55 +0000 Received: by mail-pg0-x244.google.com with SMTP id b192so14130820pga.2 for ; Tue, 24 Oct 2017 03:13:33 -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=HaAEM37uOyGZ0+V50ok4cxSWF89N037deJDmAyrzssY=; b=S6Uz2+5mq8lZ/xaKpBw5gMxSfTRJ1sqt0Iis2KlAgXomvoY7NBsUVO70WdpzxGiERV lmX0tHbDhU9bahK//5bUjPCJLeyyftJWU60jF0kpALEmkOV2A3dvAmZKCcwxUq2N45ck zWMb3O47uV1Vo0LLDEz0jtJGZAjTToQhO7yi4= 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=HaAEM37uOyGZ0+V50ok4cxSWF89N037deJDmAyrzssY=; b=kKDr9q2rUJcnPZaI0qmRpVvWen4SPKzFC094/TlTJGypRsD/s3M0gmp9iYhX0DjlK2 ylNVuyaEzp2+r0MZNSRA/sfjCsBV79tbBro09LQhCTo6cYTRDOxtuby9eCejwt3c5Vij s/I7r7P3ROCOYSAARdCA4lCeSXjfKWrc37WrTVvX687imyxMcIHYcY9kKn1WlcjJRvF8 y8J1PxBmLrxy4+e742/6m3hZsfAjRe+3RqmSUqCzkZvFUH9mmM6rIDLtfmmNV5cpvNEy ZkoxHWE+QiQRHecyf/Q5wImblL56OpThnWBZetNQzxNN5D6EL7YN71wSlieOjGaedx0k LU+A== X-Gm-Message-State: AMCzsaVGkrDkVtkf0NtgKdFSTLBJAWkGYKicV65FV5FrOf848p1pzmDV TkN8e3pOtKoolD8xNXwjqGHHfQ== X-Google-Smtp-Source: ABhQp+SEE/CggBTjXtMqlR2gwG4CGvxDN3u3pEaykimtJASn32jraPNGsM1LlJEoEwabBXf+M6Aezw== X-Received: by 10.99.97.147 with SMTP id v141mr13777779pgb.92.1508840013374; Tue, 24 Oct 2017 03:13:33 -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 d15sm17285566pfj.163.2017.10.24.03.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 03:13:32 -0700 (PDT) Date: Tue, 24 Oct 2017 03:13:31 -0700 From: Kees Cook To: Mark Rutland Subject: [PATCH] drivers/firmware: psci: Convert timers to use timer_setup() Message-ID: <20171024101331.GA69243@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171024_031354_219009_85AFF48B X-CRM114-Status: GOOD ( 11.50 ) 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: Lorenzo Pieralisi , 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. Also adds missing call to destroy_timer_on_stack(). Cc: Mark Rutland Cc: Lorenzo Pieralisi Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook --- drivers/firmware/psci_checker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/psci_checker.c b/drivers/firmware/psci_checker.c index 6523ce962865..f3f4f810e5df 100644 --- a/drivers/firmware/psci_checker.c +++ b/drivers/firmware/psci_checker.c @@ -220,7 +220,7 @@ static int hotplug_tests(void) return err; } -static void dummy_callback(unsigned long ignored) {} +static void dummy_callback(struct timer_list *unused) {} static int suspend_cpu(int index, bool broadcast) { @@ -287,7 +287,7 @@ static int suspend_test_thread(void *arg) pr_info("CPU %d entering suspend cycles, states 1 through %d\n", cpu, drv->state_count - 1); - setup_timer_on_stack(&wakeup_timer, dummy_callback, 0); + timer_setup_on_stack(&wakeup_timer, dummy_callback, 0); for (i = 0; i < NUM_SUSPEND_CYCLE; ++i) { int index; /* @@ -340,6 +340,7 @@ static int suspend_test_thread(void *arg) * later. */ del_timer(&wakeup_timer); + destroy_timer_on_stack(&wakeup_timer); if (atomic_dec_return_relaxed(&nb_active_threads) == 0) complete(&suspend_threads_done);