diff options
author | Jan Kara <jack@suse.cz> | 2019-08-26 05:36:19 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-08-26 05:36:19 -0400 |
commit | 8cbd9af9d208b1f015cf8a4645602f0a007270a8 (patch) | |
tree | 14545bcef168bccd9dc0282818961f0a98cd91a0 | |
parent | ab9a3a737284b3d9e1d2ba43a0ef31b3ef2e2417 (diff) |
udf: Use dynamic debug infrastructure
Instead of relying on UDFFS_DEBUG define for debug printing, just use
standard pr_debug() prints and rely on CONFIG_DYNAMIC_DEBUG
infrastructure for enabling or disabling prints.
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/udf/super.c | 7 | ||||
-rw-r--r-- | fs/udf/udfdecl.h | 10 |
2 files changed, 1 insertions, 16 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 00e2d7190b52..56da1e1680ea 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -812,9 +812,7 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) | |||
812 | struct buffer_head *bh; | 812 | struct buffer_head *bh; |
813 | uint16_t ident; | 813 | uint16_t ident; |
814 | int ret = -ENOMEM; | 814 | int ret = -ENOMEM; |
815 | #ifdef UDFFS_DEBUG | ||
816 | struct timestamp *ts; | 815 | struct timestamp *ts; |
817 | #endif | ||
818 | 816 | ||
819 | outstr = kmalloc(128, GFP_NOFS); | 817 | outstr = kmalloc(128, GFP_NOFS); |
820 | if (!outstr) | 818 | if (!outstr) |
@@ -835,13 +833,10 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) | |||
835 | 833 | ||
836 | udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time, | 834 | udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time, |
837 | pvoldesc->recordingDateAndTime); | 835 | pvoldesc->recordingDateAndTime); |
838 | #ifdef UDFFS_DEBUG | ||
839 | ts = &pvoldesc->recordingDateAndTime; | 836 | ts = &pvoldesc->recordingDateAndTime; |
840 | udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n", | 837 | udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n", |
841 | le16_to_cpu(ts->year), ts->month, ts->day, ts->hour, | 838 | le16_to_cpu(ts->year), ts->month, ts->day, ts->hour, |
842 | ts->minute, le16_to_cpu(ts->typeAndTimezone)); | 839 | ts->minute, le16_to_cpu(ts->typeAndTimezone)); |
843 | #endif | ||
844 | |||
845 | 840 | ||
846 | ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32); | 841 | ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32); |
847 | if (ret < 0) { | 842 | if (ret < 0) { |
@@ -1256,9 +1251,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
1256 | * PHYSICAL partitions are already set up | 1251 | * PHYSICAL partitions are already set up |
1257 | */ | 1252 | */ |
1258 | type1_idx = i; | 1253 | type1_idx = i; |
1259 | #ifdef UDFFS_DEBUG | ||
1260 | map = NULL; /* supress 'maybe used uninitialized' warning */ | 1254 | map = NULL; /* supress 'maybe used uninitialized' warning */ |
1261 | #endif | ||
1262 | for (i = 0; i < sbi->s_partitions; i++) { | 1255 | for (i = 0; i < sbi->s_partitions; i++) { |
1263 | map = &sbi->s_partmaps[i]; | 1256 | map = &sbi->s_partmaps[i]; |
1264 | 1257 | ||
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index d89ef71887fc..65e243ebeb9c 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -31,16 +31,8 @@ extern __printf(3, 4) void _udf_warn(struct super_block *sb, | |||
31 | #define udf_info(fmt, ...) \ | 31 | #define udf_info(fmt, ...) \ |
32 | pr_info("INFO " fmt, ##__VA_ARGS__) | 32 | pr_info("INFO " fmt, ##__VA_ARGS__) |
33 | 33 | ||
34 | #undef UDFFS_DEBUG | ||
35 | |||
36 | #ifdef UDFFS_DEBUG | ||
37 | #define udf_debug(fmt, ...) \ | ||
38 | printk(KERN_DEBUG pr_fmt("%s:%d:%s: " fmt), \ | ||
39 | __FILE__, __LINE__, __func__, ##__VA_ARGS__) | ||
40 | #else | ||
41 | #define udf_debug(fmt, ...) \ | 34 | #define udf_debug(fmt, ...) \ |
42 | no_printk(fmt, ##__VA_ARGS__) | 35 | pr_debug("%s:%d:%s: " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__) |
43 | #endif | ||
44 | 36 | ||
45 | #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) | 37 | #define udf_fixed_to_variable(x) ( ( ( (x) >> 5 ) * 39 ) + ( (x) & 0x0000001F ) ) |
46 | #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) | 38 | #define udf_variable_to_fixed(x) ( ( ( (x) / 39 ) << 5 ) + ( (x) % 39 ) ) |