From patchwork Thu Feb 22 14:00:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 10235635 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 54DCF60209 for ; Thu, 22 Feb 2018 14:06:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A9E228D2A for ; Thu, 22 Feb 2018 14:06:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F2F428D32; Thu, 22 Feb 2018 14:06:24 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 BFF0B28D2A for ; Thu, 22 Feb 2018 14:06:23 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=u2cqXYw/yzH9oRDUTEmTw1kbImXqIn5KsGMks+GmdCQ=; b=iQGtymDlZN323kXzitTDm+RBkw e05LOWUSJ/V4sFuwWVwEgOvzNd4oJMRIaly5eVS+cBXf31VY1+acsEcRrtk7wAvX41CPH3dYvuc/F IKXVo4zs0h/jp+0e4foPudRE8KXc8wy33wvG75Bm9x8lYHNJceC22XgqZ7bYcdUsK1cr2HBb/dlFD +4qfLWK3e2TaTTMQo7bMsKChrsFcLCEvfaRFr9Nnd6PTWyYB9guWZMsqJzV83pZP98Z8lQMH52i5B TlfamdcSKwUn56jREx8I0fkOMQTsY4P64791hrbYlC60ncRikLS2FX1ZkRHFuIsFwsKz9VC3naxme r9lsuCKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eorVm-0005Z0-CO; Thu, 22 Feb 2018 14:06:14 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eorRA-0001Ep-6m for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2018 14:01:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 04E12169F; Thu, 22 Feb 2018 06:01:02 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CABE63F5FD; Thu, 22 Feb 2018 06:01:01 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 705BD1AE541C; Thu, 22 Feb 2018 14:01:01 +0000 (GMT) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 8/9] arm64: Move show_unhandled_signals_ratelimited into traps.c Date: Thu, 22 Feb 2018 14:00:56 +0000 Message-Id: <1519308057-4953-9-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1519308057-4953-1-git-send-email-will.deacon@arm.com> References: <1519308057-4953-1-git-send-email-will.deacon@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180222_060128_353600_57164A5F X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. 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: mark.rutland@arm.com, Will Deacon , dave.martin@arm.com MIME-Version: 1.0 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 show_unhandled_signals_ratelimited is only called in traps.c, so move it out of its macro in the dreaded system_misc.h and into a static function in traps.c Signed-off-by: Will Deacon --- arch/arm64/include/asm/system_misc.h | 11 ----------- arch/arm64/kernel/traps.c | 7 +++++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h index 07aa8e3c5630..28893a0b141d 100644 --- a/arch/arm64/include/asm/system_misc.h +++ b/arch/arm64/include/asm/system_misc.h @@ -45,17 +45,6 @@ extern void __show_regs(struct pt_regs *); extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); -#define show_unhandled_signals_ratelimited() \ -({ \ - static DEFINE_RATELIMIT_STATE(_rs, \ - DEFAULT_RATELIMIT_INTERVAL, \ - DEFAULT_RATELIMIT_BURST); \ - bool __show_ratelimited = false; \ - if (show_unhandled_signals && __ratelimit(&_rs)) \ - __show_ratelimited = true; \ - __show_ratelimited; \ -}) - int handle_guest_sea(phys_addr_t addr, unsigned int esr); #endif /* __ASSEMBLY__ */ diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 637ae3702950..4231488a5a9f 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -223,6 +223,13 @@ void die(const char *str, struct pt_regs *regs, int err) do_exit(SIGSEGV); } +static bool show_unhandled_signals_ratelimited(void) +{ + static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, + DEFAULT_RATELIMIT_BURST); + return show_unhandled_signals && __ratelimit(&rs); +} + void arm64_force_sig_info(struct siginfo *info, const char *str, struct task_struct *tsk) {