[UNNECESSARY PATCH 04/16] signal: Use pr_<level>

From: Joe Perches
Date: Sun Nov 16 2014 - 15:09:42 EST


Use the more current logging style.

Add pr_fmt to prefix messages with "signal: "
Remove local use of DEFINE_RATELIMIT_STATE and __ratelimit and
use pr_info_ratelimited instead.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
kernel/signal.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 969c6ba..0efde2d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -10,6 +10,8 @@
* to allow signals to be sent reliably.
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/init.h>
@@ -216,16 +218,11 @@ int next_signal(struct sigpending *pending, sigset_t *mask)

static inline void print_dropped_signal(int sig)
{
- static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
-
if (!print_fatal_signals)
return;

- if (!__ratelimit(&ratelimit_state))
- return;
-
- printk(KERN_INFO "%s/%d: reached RLIMIT_SIGPENDING, dropped signal %d\n",
- current->comm, current->pid, sig);
+ pr_info_ratelimited("%s/%d: reached RLIMIT_SIGPENDING, dropped signal %d\n",
+ current->comm, current->pid, sig);
}

/**
@@ -1147,10 +1144,10 @@ static void print_fatal_signal(int signr)
{
struct pt_regs *regs = signal_pt_regs();

- printk(KERN_INFO "potentially unexpected fatal signal %d.\n", signr);
+ pr_info("potentially unexpected fatal signal %d\n", signr);

#if defined(__i386__) && !defined(__arch_um__)
- printk(KERN_INFO "code at %08lx: ", regs->ip);
+ pr_info("code at %08lx:", regs->ip);
{
int i;

@@ -1159,10 +1156,10 @@ static void print_fatal_signal(int signr)

if (get_user(insn, (unsigned char *)(regs->ip + i)))
break;
- printk(KERN_CONT "%02x ", insn);
+ pr_cont(" %02x", insn);
}
}
- printk(KERN_CONT "\n");
+ pr_cont("\n");
#endif
preempt_disable();
show_regs(regs);
--
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/