aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-15 18:56:46 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:42:14 -0400
commit9bbf29e4757fb152c8673eda0b1e9d507b953df9 (patch)
treeca2462838286fb1e7fe06e4a6fedf78ac36d4904 /fs
parent5a528957e7c74f1fed73fe20424b7a3421658877 (diff)
jffs2: Standardize JFFS_<LEVEL> uses
Use pr_<level> to prefix KBUILD_MODNAME via pr_fmt. Remove obfuscating defines and use constants in pr_<level> No need for a do {} while (0) for single statements. Form of JFFS_<LEVEL> output changes from "JFFS2 notice: " to "jffs2: notice: " Added pr_fmt to xattr.c Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/debug.c2
-rw-r--r--fs/jffs2/debug.h43
-rw-r--r--fs/jffs2/xattr.c2
3 files changed, 13 insertions, 34 deletions
diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c
index f8a99a371508..1090eb64b90d 100644
--- a/fs/jffs2/debug.c
+++ b/fs/jffs2/debug.c
@@ -267,7 +267,7 @@ void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
267do { \ 267do { \
268 if (sz != c->sz##_size) { \ 268 if (sz != c->sz##_size) { \
269 pr_warn("%s_size mismatch counted 0x%x, c->%s_size 0x%x\n", \ 269 pr_warn("%s_size mismatch counted 0x%x, c->%s_size 0x%x\n", \
270 #sz, #sz, sz, c->sz##_size); \ 270 #sz, sz, #sz, c->sz##_size); \
271 dump = 1; \ 271 dump = 1; \
272 } \ 272 } \
273} while (0) 273} while (0)
diff --git a/fs/jffs2/debug.h b/fs/jffs2/debug.h
index 7782c6355a5f..4fd9be4cbc98 100644
--- a/fs/jffs2/debug.h
+++ b/fs/jffs2/debug.h
@@ -70,49 +70,26 @@ do { \
70} while (0) 70} while (0)
71 71
72/* The prefixes of JFFS2 messages */ 72/* The prefixes of JFFS2 messages */
73#define JFFS2_DBG KERN_DEBUG
73#define JFFS2_DBG_PREFIX "[JFFS2 DBG]" 74#define JFFS2_DBG_PREFIX "[JFFS2 DBG]"
74#define JFFS2_ERR_PREFIX "JFFS2 error:"
75#define JFFS2_WARN_PREFIX "JFFS2 warning:"
76#define JFFS2_NOTICE_PREFIX "JFFS2 notice:"
77
78#define JFFS2_ERR KERN_ERR
79#define JFFS2_WARN KERN_WARNING
80#define JFFS2_NOT KERN_NOTICE
81#define JFFS2_DBG KERN_DEBUG
82
83#define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX 75#define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX
84#define JFFS2_ERR_MSG_PREFIX JFFS2_ERR JFFS2_ERR_PREFIX
85#define JFFS2_WARN_MSG_PREFIX JFFS2_WARN JFFS2_WARN_PREFIX
86#define JFFS2_NOTICE_MSG_PREFIX JFFS2_NOT JFFS2_NOTICE_PREFIX
87 76
88/* JFFS2 message macros */ 77/* JFFS2 message macros */
89#define JFFS2_ERROR(fmt, ...) \ 78#define JFFS2_ERROR(fmt, ...) \
90 do { \ 79 pr_err("error: (%d) %s: " fmt, \
91 printk(JFFS2_ERR_MSG_PREFIX \ 80 task_pid_nr(current), __func__, ##__VA_ARGS__)
92 " (%d) %s: " fmt, task_pid_nr(current), \
93 __func__ , ##__VA_ARGS__); \
94 } while(0)
95 81
96#define JFFS2_WARNING(fmt, ...) \ 82#define JFFS2_WARNING(fmt, ...) \
97 do { \ 83 pr_warn("warning: (%d) %s: " fmt, \
98 printk(JFFS2_WARN_MSG_PREFIX \ 84 task_pid_nr(current), __func__, ##__VA_ARGS__)
99 " (%d) %s: " fmt, task_pid_nr(current), \
100 __func__ , ##__VA_ARGS__); \
101 } while(0)
102 85
103#define JFFS2_NOTICE(fmt, ...) \ 86#define JFFS2_NOTICE(fmt, ...) \
104 do { \ 87 pr_notice("notice: (%d) %s: " fmt, \
105 printk(JFFS2_NOTICE_MSG_PREFIX \ 88 task_pid_nr(current), __func__, ##__VA_ARGS__)
106 " (%d) %s: " fmt, task_pid_nr(current), \
107 __func__ , ##__VA_ARGS__); \
108 } while(0)
109 89
110#define JFFS2_DEBUG(fmt, ...) \ 90#define JFFS2_DEBUG(fmt, ...) \
111 do { \ 91 printk(KERN_DEBUG "[JFFS2 DBG] (%d) %s: " fmt, \
112 printk(JFFS2_DBG_MSG_PREFIX \ 92 task_pid_nr(current), __func__, ##__VA_ARGS__)
113 " (%d) %s: " fmt, task_pid_nr(current), \
114 __func__ , ##__VA_ARGS__); \
115 } while(0)
116 93
117/* 94/*
118 * We split our debugging messages on several parts, depending on the JFFS2 95 * We split our debugging messages on several parts, depending on the JFFS2
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index 3e93cdd19005..b55b803eddcb 100644
--- a/fs/jffs2/xattr.c
+++ b/fs/jffs2/xattr.c
@@ -9,6 +9,8 @@
9 * 9 *
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/kernel.h> 14#include <linux/kernel.h>
13#include <linux/slab.h> 15#include <linux/slab.h>
14#include <linux/fs.h> 16#include <linux/fs.h>