summaryrefslogtreecommitdiffstats
path: root/fs/udf/udfdecl.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-10-10 01:08:05 -0700
committerJan Kara <jack@suse.cz>2011-10-31 23:43:52 +0100
commit78ace70c4186c0d18314eb001637aa97d1585e65 (patch)
tree34227a6d50b93eb66df22ba130bea8ed932a5896 /fs/udf/udfdecl.h
parenta40ecd7b3ccf520ff02da93e8d1ba6cd55c2e359 (diff)
downloadop-kernel-dev-78ace70c4186c0d18314eb001637aa97d1585e65.zip
op-kernel-dev-78ace70c4186c0d18314eb001637aa97d1585e65.tar.gz
udf: Convert printks to pr_<level>
Use the current logging styles. Convert a few printks that should have been udf_warn and udf_err. Coalesce formats. Add #define pr_fmt. Move an #include "udfdecls.h" above other includes in udftime.c so pr_fmt works correctly. Strip prefixes from conversions as appropriate. Reorder logging definitions in udfdecl.h Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/udfdecl.h')
-rw-r--r--fs/udf/udfdecl.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 85e15ed..f3d44986 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -1,6 +1,8 @@
#ifndef __UDF_DECL_H
#define __UDF_DECL_H
+#define pr_fmt(fmt) "UDF-fs: " fmt
+
#include "ecma_167.h"
#include "osta_udf.h"
@@ -16,18 +18,11 @@
#define UDF_PREALLOCATE
#define UDF_DEFAULT_PREALLOC_BLOCKS 8
-#undef UDFFS_DEBUG
-
-#ifdef UDFFS_DEBUG
-#define udf_debug(f, a...) \
-do { \
- printk(KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
- __FILE__, __LINE__, __func__); \
- printk(f, ##a); \
-} while (0)
-#else
-#define udf_debug(f, a...) /**/
-#endif
+__attribute__((format(printf, 3, 4)))
+extern void _udf_err(struct super_block *sb, const char *function,
+ const char *fmt, ...);
+#define udf_err(sb, fmt, ...) \
+ _udf_err(sb, __func__, fmt, ##__VA_ARGS__)
__attribute__((format(printf, 3, 4)))
extern void _udf_warn(struct super_block *sb, const char *function,
@@ -35,14 +30,19 @@ extern void _udf_warn(struct super_block *sb, const char *function,
#define udf_warn(sb, fmt, ...) \
_udf_warn(sb, __func__, fmt, ##__VA_ARGS__)
-__attribute__((format(printf, 3, 4)))
-extern void _udf_err(struct super_block *sb, const char *function,
- const char *fmt, ...);
-#define udf_err(sb, fmt, ...) \
- _udf_err(sb, __func__, fmt, ##__VA_ARGS__)
+#define udf_info(fmt, ...) \
+ pr_info("INFO " fmt, ##__VA_ARGS__)
-#define udf_info(f, a...) \
- printk(KERN_INFO "UDF-fs INFO " f, ##a);
+#undef UDFFS_DEBUG
+
+#ifdef UDFFS_DEBUG
+#define udf_debug(fmt, ...) \
+ printk(KERN_DEBUG pr_fmt("%s:%d:%s: " fmt), \
+ __FILE__, __LINE__, __func__, ##__VA_ARGS__)
+#else
+#define udf_debug(fmt, ...) \
+ no_printk(fmt, ##__VA_ARGS__)
+#endif
#define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) )
#define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) )
OpenPOWER on IntegriCloud