aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-11 06:08:51 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-16 07:50:16 -0400
commit6f9fdf62db64b1e52e5b7a9f785554e8b877b65c (patch)
treea42ef328d49bbdafac26c4d84eb4c8afba8be874 /drivers/mtd
parent6edb9793959fb547a15d5ffe6b142d9f0b3e41a6 (diff)
UBI: remove UBI_IO_DEBUG macro
This additional little macro is used to print a bit more messages while scanning the media. However, we have the 'dbg_bld()' macro for this, so we better us 'dbg_bld()' and kill UBI_IO_DEBUG. This simplifies the code a tiny bit. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/debug.h3
-rw-r--r--drivers/mtd/ubi/io.c34
2 files changed, 16 insertions, 21 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index 9eca95074bc2..8bd1d17c1bd3 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -91,10 +91,8 @@ void ubi_dbg_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len);
91#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD 91#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
92/* Initialization and build messages */ 92/* Initialization and build messages */
93#define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) 93#define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
94#define UBI_IO_DEBUG 1
95#else 94#else
96#define dbg_bld(fmt, ...) ({}) 95#define dbg_bld(fmt, ...) ({})
97#define UBI_IO_DEBUG 0
98#endif 96#endif
99 97
100#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID 98#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
@@ -177,7 +175,6 @@ static inline int ubi_dbg_is_erase_failure(void)
177#define ubi_dbg_dump_flash(ubi, pnum, offset, len) ({}) 175#define ubi_dbg_dump_flash(ubi, pnum, offset, len) ({})
178#define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) ({}) 176#define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) ({})
179 177
180#define UBI_IO_DEBUG 0
181#define DBG_DISABLE_BGT 0 178#define DBG_DISABLE_BGT 0
182#define ubi_dbg_is_bitflip() 0 179#define ubi_dbg_is_bitflip() 0
183#define ubi_dbg_is_write_failure() 0 180#define ubi_dbg_is_write_failure() 0
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 35da5aadbe10..b1ad1ec812ad 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -783,9 +783,8 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
783 if (verbose) 783 if (verbose)
784 ubi_warn("no EC header found at PEB %d, " 784 ubi_warn("no EC header found at PEB %d, "
785 "only 0xFF bytes", pnum); 785 "only 0xFF bytes", pnum);
786 else if (UBI_IO_DEBUG) 786 dbg_bld("no EC header found at PEB %d, "
787 dbg_msg("no EC header found at PEB %d, " 787 "only 0xFF bytes", pnum);
788 "only 0xFF bytes", pnum);
789 if (!read_err) 788 if (!read_err)
790 return UBI_IO_FF; 789 return UBI_IO_FF;
791 else 790 else
@@ -800,9 +799,9 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
800 ubi_warn("bad magic number at PEB %d: %08x instead of " 799 ubi_warn("bad magic number at PEB %d: %08x instead of "
801 "%08x", pnum, magic, UBI_EC_HDR_MAGIC); 800 "%08x", pnum, magic, UBI_EC_HDR_MAGIC);
802 ubi_dbg_dump_ec_hdr(ec_hdr); 801 ubi_dbg_dump_ec_hdr(ec_hdr);
803 } else if (UBI_IO_DEBUG) 802 }
804 dbg_msg("bad magic number at PEB %d: %08x instead of " 803 dbg_bld("bad magic number at PEB %d: %08x instead of "
805 "%08x", pnum, magic, UBI_EC_HDR_MAGIC); 804 "%08x", pnum, magic, UBI_EC_HDR_MAGIC);
806 return UBI_IO_BAD_HDR; 805 return UBI_IO_BAD_HDR;
807 } 806 }
808 807
@@ -814,9 +813,9 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
814 ubi_warn("bad EC header CRC at PEB %d, calculated " 813 ubi_warn("bad EC header CRC at PEB %d, calculated "
815 "%#08x, read %#08x", pnum, crc, hdr_crc); 814 "%#08x, read %#08x", pnum, crc, hdr_crc);
816 ubi_dbg_dump_ec_hdr(ec_hdr); 815 ubi_dbg_dump_ec_hdr(ec_hdr);
817 } else if (UBI_IO_DEBUG) 816 }
818 dbg_msg("bad EC header CRC at PEB %d, calculated " 817 dbg_bld("bad EC header CRC at PEB %d, calculated "
819 "%#08x, read %#08x", pnum, crc, hdr_crc); 818 "%#08x, read %#08x", pnum, crc, hdr_crc);
820 819
821 if (!read_err) 820 if (!read_err)
822 return UBI_IO_BAD_HDR; 821 return UBI_IO_BAD_HDR;
@@ -1039,9 +1038,8 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1039 if (verbose) 1038 if (verbose)
1040 ubi_warn("no VID header found at PEB %d, " 1039 ubi_warn("no VID header found at PEB %d, "
1041 "only 0xFF bytes", pnum); 1040 "only 0xFF bytes", pnum);
1042 else if (UBI_IO_DEBUG) 1041 dbg_bld("no VID header found at PEB %d, "
1043 dbg_msg("no VID header found at PEB %d, " 1042 "only 0xFF bytes", pnum);
1044 "only 0xFF bytes", pnum);
1045 if (!read_err) 1043 if (!read_err)
1046 return UBI_IO_FF; 1044 return UBI_IO_FF;
1047 else 1045 else
@@ -1052,9 +1050,9 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1052 ubi_warn("bad magic number at PEB %d: %08x instead of " 1050 ubi_warn("bad magic number at PEB %d: %08x instead of "
1053 "%08x", pnum, magic, UBI_VID_HDR_MAGIC); 1051 "%08x", pnum, magic, UBI_VID_HDR_MAGIC);
1054 ubi_dbg_dump_vid_hdr(vid_hdr); 1052 ubi_dbg_dump_vid_hdr(vid_hdr);
1055 } else if (UBI_IO_DEBUG) 1053 }
1056 dbg_msg("bad magic number at PEB %d: %08x instead of " 1054 dbg_bld("bad magic number at PEB %d: %08x instead of "
1057 "%08x", pnum, magic, UBI_VID_HDR_MAGIC); 1055 "%08x", pnum, magic, UBI_VID_HDR_MAGIC);
1058 return UBI_IO_BAD_HDR; 1056 return UBI_IO_BAD_HDR;
1059 } 1057 }
1060 1058
@@ -1066,9 +1064,9 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1066 ubi_warn("bad CRC at PEB %d, calculated %#08x, " 1064 ubi_warn("bad CRC at PEB %d, calculated %#08x, "
1067 "read %#08x", pnum, crc, hdr_crc); 1065 "read %#08x", pnum, crc, hdr_crc);
1068 ubi_dbg_dump_vid_hdr(vid_hdr); 1066 ubi_dbg_dump_vid_hdr(vid_hdr);
1069 } else if (UBI_IO_DEBUG) 1067 }
1070 dbg_msg("bad CRC at PEB %d, calculated %#08x, " 1068 dbg_bld("bad CRC at PEB %d, calculated %#08x, "
1071 "read %#08x", pnum, crc, hdr_crc); 1069 "read %#08x", pnum, crc, hdr_crc);
1072 if (!read_err) 1070 if (!read_err)
1073 return UBI_IO_BAD_HDR; 1071 return UBI_IO_BAD_HDR;
1074 else 1072 else