if (unlikely(!(expr))) { \
printk(KERN_CRIT "UBI assert failed in %s at %u (pid %d)\n", \
__func__, __LINE__, current->pid); \
- ubi_dbg_dump_stack(); \
+ dump_stack(); \
} \
} while (0)
#define dbg_err(fmt, ...) ubi_err(fmt, ##__VA_ARGS__)
-#define ubi_dbg_dump_stack() dump_stack()
-
#define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) \
print_hex_dump(l, ps, pt, r, g, b, len, a)
#define dbg_io(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_bld(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)
-static inline void ubi_dbg_dump_stack(void) { return; }
static inline void
ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) { return; }
static inline void
ubi_err("error %d%s while reading %d bytes from PEB %d:%d, "
"read %zd bytes", err, errstr, len, pnum, offset, read);
- ubi_dbg_dump_stack();
+ dump_stack();
/*
* The driver should never return -EBADMSG if it failed to read
if (ubi_dbg_is_write_failure(ubi)) {
dbg_err("cannot write %d bytes to PEB %d:%d "
"(emulated)", len, pnum, offset);
- ubi_dbg_dump_stack();
+ dump_stack();
return -EIO;
}
if (err) {
ubi_err("error %d while writing %d bytes to PEB %d:%d, written "
"%zd bytes", err, len, pnum, offset, written);
- ubi_dbg_dump_stack();
+ dump_stack();
ubi_dbg_dump_flash(ubi, pnum, offset, len);
} else
ubi_assert(written == len);
goto retry;
}
ubi_err("cannot erase PEB %d, error %d", pnum, err);
- ubi_dbg_dump_stack();
+ dump_stack();
return err;
}
goto retry;
}
ubi_err("cannot erase PEB %d", pnum);
- ubi_dbg_dump_stack();
+ dump_stack();
return -EIO;
}
bad:
ubi_err("bad EC header");
ubi_dbg_dump_ec_hdr(ec_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
return 1;
}
bad:
ubi_err("bad VID header");
ubi_dbg_dump_vid_hdr(vid_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
return 1;
}
return err;
ubi_err("paranoid check failed for PEB %d", pnum);
- ubi_dbg_dump_stack();
+ dump_stack();
return err > 0 ? -EINVAL : err;
}
fail:
ubi_dbg_dump_ec_hdr(ec_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
return -EINVAL;
}
ubi_err("bad CRC, calculated %#08x, read %#08x", crc, hdr_crc);
ubi_err("paranoid check failed for PEB %d", pnum);
ubi_dbg_dump_ec_hdr(ec_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
err = -EINVAL;
goto exit;
}
fail:
ubi_err("paranoid check failed for PEB %d", pnum);
ubi_dbg_dump_vid_hdr(vid_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
return -EINVAL;
}
"read %#08x", pnum, crc, hdr_crc);
ubi_err("paranoid check failed for PEB %d", pnum);
ubi_dbg_dump_vid_hdr(vid_hdr);
- ubi_dbg_dump_stack();
+ dump_stack();
err = -EINVAL;
goto exit;
}
i, i + dump_len);
print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
buf1 + i, dump_len, 1);
- ubi_dbg_dump_stack();
+ dump_stack();
err = -EINVAL;
goto out_free;
}
print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, buf, len, 1);
err = -EINVAL;
error:
- ubi_dbg_dump_stack();
+ dump_stack();
vfree(buf);
return err;
}