arm64: Move show_unhandled_signals_ratelimited into traps.c
authorWill Deacon <will.deacon@arm.com>
Tue, 20 Feb 2018 15:08:51 +0000 (15:08 +0000)
committerWill Deacon <will.deacon@arm.com>
Tue, 6 Mar 2018 18:52:31 +0000 (18:52 +0000)
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 <will.deacon@arm.com>
arch/arm64/include/asm/system_misc.h
arch/arm64/kernel/traps.c

index 07aa8e3c56305e8ce08b6dcfcb9d1acaa193bb17..28893a0b141d2b29d591bb9b8fee34223551261e 100644 (file)
@@ -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__ */
index 835411cab38c0b94ceb6cd66a9943f70e8d772d4..b139fe2d21260491d6ba310ae07746f4c2cb1e4b 100644 (file)
@@ -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)
 {