From 78ace70c4186c0d18314eb001637aa97d1585e65 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 10 Oct 2011 01:08:05 -0700 Subject: udf: Convert printks to pr_ 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 Signed-off-by: Jan Kara --- fs/udf/udfdecl.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'fs/udf/udfdecl.h') diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 85e15edc080f..f3d449867301 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 ) ) -- cgit v1.2.3