aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-17 06:26:24 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-20 01:30:34 -0400
commitebfce01a6dfa2bd30a16efdeb417862ea0355d3b (patch)
tree5fb8690771e2b75a1945b150124271aa250f91dc /drivers/mtd/ubi
parent3802243a189b0f153acb03f531daf35d40bc38bb (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/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/debug.h63
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
24struct ubi_ec_hdr;
25struct ubi_vid_hdr;
26struct ubi_volume;
27struct ubi_vtbl_record;
28struct ubi_scan_volume;
29struct ubi_scan_leb;
30struct 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
48struct ubi_ec_hdr;
49struct ubi_vid_hdr;
50struct ubi_volume;
51struct ubi_vtbl_record;
52struct ubi_scan_volume;
53struct ubi_scan_leb;
54struct ubi_mkvol_req;
55
56void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); 56void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr);
57void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); 57void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
58void ubi_dbg_dump_vol_info(const struct ubi_volume *vol); 58void 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() ({}) 212static inline void ubi_dbg_dump_stack(void) { return; }
213#define ubi_dbg_dump_ec_hdr(ec_hdr) ({}) 213static inline void
214#define ubi_dbg_dump_vid_hdr(vid_hdr) ({}) 214ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) { return; }
215#define ubi_dbg_dump_vol_info(vol) ({}) 215static inline void
216#define ubi_dbg_dump_vtbl_record(r, idx) ({}) 216ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) { return; }
217#define ubi_dbg_dump_sv(sv) ({}) 217static inline void
218#define ubi_dbg_dump_seb(seb, type) ({}) 218ubi_dbg_dump_vol_info(const struct ubi_volume *vol) { return; }
219#define ubi_dbg_dump_mkvol_req(req) ({}) 219static inline void
220#define ubi_dbg_dump_flash(ubi, pnum, offset, len) ({}) 220ubi_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) ({}) 221static inline void ubi_dbg_dump_sv(const struct ubi_scan_volume *sv) { return; }
222 222static 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 224static inline void
225#define ubi_dbg_is_write_failure() 0 225ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req) { return; }
226#define ubi_dbg_is_erase_failure() 0 226static 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 228static inline void
229ubi_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
232static inline int ubi_dbg_is_bgt_disabled(void) { return 0; }
233static inline int ubi_dbg_is_bitflip(void) { return 0; }
234static inline int ubi_dbg_is_write_failure(void) { return 0; }
235static inline int ubi_dbg_is_erase_failure(void) { return 0; }
236static inline int ubi_dbg_check_all_ff(struct ubi_device *ubi,
237 int pnum, int offset,
238 int len) { return 0; }
239static 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__ */