Messages in this thread Patch in this message |  | | From | Joe Perches <> | Subject | [PATCH 8/8] security: yama: Use a more current logging style | Date | Mon, 24 Feb 2014 14:00:01 -0800 |
| |
Convert printks to pr_<level>. Add pr_fmt to prefix with "yama: " Convert printk_ratelimited to pr_<level>_ratelimited.
Signed-off-by: Joe Perches <joe@perches.com> --- security/yama/yama_lsm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 13c88fbc..9de0f2b 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c @@ -12,6 +12,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/security.h> #include <linux/sysctl.h> #include <linux/ptrace.h> @@ -319,9 +321,8 @@ int yama_ptrace_access_check(struct task_struct *child, } if (rc) { - printk_ratelimited(KERN_NOTICE - "ptrace of pid %d was attempted by: %s (pid %d)\n", - child->pid, current->comm, current->pid); + pr_notice_ratelimited("ptrace of pid %d was attempted by: %s (pid %d)\n", + child->pid, current->comm, current->pid); } return rc; @@ -356,9 +357,8 @@ int yama_ptrace_traceme(struct task_struct *parent) } if (rc) { - printk_ratelimited(KERN_NOTICE - "ptraceme of pid %d was attempted by: %s (pid %d)\n", - current->pid, parent->comm, parent->pid); + pr_notice_ratelimited("ptraceme of pid %d was attempted by: %s (pid %d)\n", + current->pid, parent->comm, parent->pid); } return rc; @@ -425,16 +425,16 @@ static __init int yama_init(void) return 0; #endif - printk(KERN_INFO "Yama: becoming mindful.\n"); + pr_info("becoming mindful\n"); #ifndef CONFIG_SECURITY_YAMA_STACKED if (register_security(&yama_ops)) - panic("Yama: kernel registration failed.\n"); + panic("Yama: kernel registration failed\n"); #endif #ifdef CONFIG_SYSCTL if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table)) - panic("Yama: sysctl registration failed.\n"); + panic("Yama: sysctl registration failed\n"); #endif return 0; -- 1.8.1.2.459.gbcd45b4.dirty
|  |