diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-17 06:26:24 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-20 01:30:34 -0400 |
commit | ebfce01a6dfa2bd30a16efdeb417862ea0355d3b (patch) | |
tree | 5fb8690771e2b75a1945b150124271aa250f91dc /drivers | |
parent | 3802243a189b0f153acb03f531daf35d40bc38bb (diff) |
UBI: turn some macros into static inline
Similarly as we have done for UBIFS in
1dcffad74183bb00e8129ba1c5bb2c9931d31bd7, turn the debugging macros into static
inline functions, for the same reasons: to avoid gcc 4.5 warnings.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/ubi/debug.h | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index bdd2c73fa3a1..b2dba2c20387 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h | |||
@@ -21,6 +21,14 @@ | |||
21 | #ifndef __UBI_DEBUG_H__ | 21 | #ifndef __UBI_DEBUG_H__ |
22 | #define __UBI_DEBUG_H__ | 22 | #define __UBI_DEBUG_H__ |
23 | 23 | ||
24 | struct ubi_ec_hdr; | ||
25 | struct ubi_vid_hdr; | ||
26 | struct ubi_volume; | ||
27 | struct ubi_vtbl_record; | ||
28 | struct ubi_scan_volume; | ||
29 | struct ubi_scan_leb; | ||
30 | struct ubi_mkvol_req; | ||
31 | |||
24 | #ifdef CONFIG_MTD_UBI_DEBUG | 32 | #ifdef CONFIG_MTD_UBI_DEBUG |
25 | #include <linux/random.h> | 33 | #include <linux/random.h> |
26 | 34 | ||
@@ -45,14 +53,6 @@ | |||
45 | 53 | ||
46 | #define ubi_dbg_dump_stack() dump_stack() | 54 | #define ubi_dbg_dump_stack() dump_stack() |
47 | 55 | ||
48 | struct ubi_ec_hdr; | ||
49 | struct ubi_vid_hdr; | ||
50 | struct ubi_volume; | ||
51 | struct ubi_vtbl_record; | ||
52 | struct ubi_scan_volume; | ||
53 | struct ubi_scan_leb; | ||
54 | struct ubi_mkvol_req; | ||
55 | |||
56 | void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); | 56 | void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); |
57 | void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); | 57 | void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); |
58 | void ubi_dbg_dump_vol_info(const struct ubi_volume *vol); | 58 | void ubi_dbg_dump_vol_info(const struct ubi_volume *vol); |
@@ -209,23 +209,36 @@ static inline int ubi_dbg_is_erase_failure(void) | |||
209 | #define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 209 | #define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) |
210 | #define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 210 | #define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) |
211 | 211 | ||
212 | #define ubi_dbg_dump_stack() ({}) | 212 | static inline void ubi_dbg_dump_stack(void) { return; } |
213 | #define ubi_dbg_dump_ec_hdr(ec_hdr) ({}) | 213 | static inline void |
214 | #define ubi_dbg_dump_vid_hdr(vid_hdr) ({}) | 214 | ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) { return; } |
215 | #define ubi_dbg_dump_vol_info(vol) ({}) | 215 | static inline void |
216 | #define ubi_dbg_dump_vtbl_record(r, idx) ({}) | 216 | ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) { return; } |
217 | #define ubi_dbg_dump_sv(sv) ({}) | 217 | static inline void |
218 | #define ubi_dbg_dump_seb(seb, type) ({}) | 218 | ubi_dbg_dump_vol_info(const struct ubi_volume *vol) { return; } |
219 | #define ubi_dbg_dump_mkvol_req(req) ({}) | 219 | static inline void |
220 | #define ubi_dbg_dump_flash(ubi, pnum, offset, len) ({}) | 220 | ubi_dbg_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx) { return; } |
221 | #define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) ({}) | 221 | static inline void ubi_dbg_dump_sv(const struct ubi_scan_volume *sv) { return; } |
222 | 222 | static inline void ubi_dbg_dump_seb(const struct ubi_scan_leb *seb, | |
223 | #define ubi_dbg_is_bgt_disabled() 0 | 223 | int type) { return; } |
224 | #define ubi_dbg_is_bitflip() 0 | 224 | static inline void |
225 | #define ubi_dbg_is_write_failure() 0 | 225 | ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req) { return; } |
226 | #define ubi_dbg_is_erase_failure() 0 | 226 | static inline void ubi_dbg_dump_flash(struct ubi_device *ubi, |
227 | #define ubi_dbg_check_all_ff(ubi, pnum, offset, len) 0 | 227 | int pnum, int offset, int len) { return; } |
228 | #define ubi_dbg_check_write(ubi, buf, pnum, offset, len) 0 | 228 | static inline void |
229 | ubi_dbg_print_hex_dump(const char *l, const char *ps, int pt, int r, | ||
230 | int g, const void *b, size_t len, bool a) { return; } | ||
231 | |||
232 | static inline int ubi_dbg_is_bgt_disabled(void) { return 0; } | ||
233 | static inline int ubi_dbg_is_bitflip(void) { return 0; } | ||
234 | static inline int ubi_dbg_is_write_failure(void) { return 0; } | ||
235 | static inline int ubi_dbg_is_erase_failure(void) { return 0; } | ||
236 | static inline int ubi_dbg_check_all_ff(struct ubi_device *ubi, | ||
237 | int pnum, int offset, | ||
238 | int len) { return 0; } | ||
239 | static inline int ubi_dbg_check_write(struct ubi_device *ubi, | ||
240 | const void *buf, int pnum, | ||
241 | int offset, int len) { return 0; } | ||
229 | 242 | ||
230 | #endif /* !CONFIG_MTD_UBI_DEBUG */ | 243 | #endif /* !CONFIG_MTD_UBI_DEBUG */ |
231 | #endif /* !__UBI_DEBUG_H__ */ | 244 | #endif /* !__UBI_DEBUG_H__ */ |