Convert printks to pr_<level>.
Add pr_fmt to prefix with "yama: "
Convert printk_ratelimited to pr_<level>_ratelimited.

Signed-off-by: Joe Perches <j...@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

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

Reply via email to