[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ff8a7d422cfa605de40dc64c103f27ed7a76e0cf.1393279025.git.joe@perches.com>
Date: Mon, 24 Feb 2014 13:59:55 -0800
From: Joe Perches <joe@...ches.com>
To: linux-kernel@...r.kernel.org
Cc: John Johansen <john.johansen@...onical.com>,
James Morris <james.l.morris@...cle.com>,
linux-security-module@...r.kernel.org
Subject: [PATCH 2/8] security: apparmor: Use a more current logging style
Convert printks to pr_<level>.
Add pr_fmt.
Coalesce formats.
Remove embedded prefixes from logging.
Signed-off-by: Joe Perches <joe@...ches.com>
---
security/apparmor/apparmorfs.c | 2 ++
security/apparmor/crypto.c | 2 ++
security/apparmor/include/apparmor.h | 2 +-
security/apparmor/lib.c | 4 +++-
security/apparmor/lsm.c | 2 ++
security/apparmor/match.c | 5 +++--
security/apparmor/policy.c | 2 ++
security/apparmor/procattr.c | 2 ++
8 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 7db9954..d4b65cc 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -12,6 +12,8 @@
* License.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <linux/ctype.h>
#include <linux/security.h>
#include <linux/vmalloc.h>
diff --git a/security/apparmor/crypto.c b/security/apparmor/crypto.c
index 532471d..9506544 100644
--- a/security/apparmor/crypto.c
+++ b/security/apparmor/crypto.c
@@ -15,6 +15,8 @@
* it should be.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <crypto/hash.h>
#include "include/apparmor.h"
diff --git a/security/apparmor/include/apparmor.h b/security/apparmor/include/apparmor.h
index 8fb1488..3065025 100644
--- a/security/apparmor/include/apparmor.h
+++ b/security/apparmor/include/apparmor.h
@@ -56,7 +56,7 @@ extern unsigned int aa_g_path_max;
#define AA_ERROR(fmt, args...) \
do { \
if (printk_ratelimit()) \
- printk(KERN_ERR "AppArmor: " fmt, ##args); \
+ pr_err(fmt, ##args); \
} while (0)
/* Flag indicating whether initialization completed */
diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
index 6968992..432b1b6 100644
--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -12,6 +12,8 @@
* License.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/string.h>
@@ -73,7 +75,7 @@ void aa_info_message(const char *str)
aad.info = str;
aa_audit_msg(AUDIT_APPARMOR_STATUS, &sa, NULL);
}
- printk(KERN_INFO "AppArmor: %s\n", str);
+ pr_info("%s\n", str);
}
/**
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 9981000..49f0180 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -12,6 +12,8 @@
* License.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <linux/security.h>
#include <linux/moduleparam.h>
#include <linux/mm.h>
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 727eb42..688482a 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -12,6 +12,8 @@
* License.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
@@ -140,8 +142,7 @@ static int verify_dfa(struct aa_dfa *dfa, int flags)
if (DEFAULT_TABLE(dfa)[i] >= state_count)
goto out;
if (base_idx(BASE_TABLE(dfa)[i]) + 255 >= trans_count) {
- printk(KERN_ERR "AppArmor DFA next/check upper "
- "bounds error\n");
+ pr_err("DFA next/check upper bounds error\n");
goto out;
}
}
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index 705c287..4e20c1f 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -73,6 +73,8 @@
* FIXME: move profile lists to using rcu_lists
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
diff --git a/security/apparmor/procattr.c b/security/apparmor/procattr.c
index b125acc..c105fc5 100644
--- a/security/apparmor/procattr.c
+++ b/security/apparmor/procattr.c
@@ -12,6 +12,8 @@
* License.
*/
+#define pr_fmt(fmt) "AppArmor: " fmt
+
#include "include/apparmor.h"
#include "include/context.h"
#include "include/policy.h"
--
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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists