linuxkpi: Define dev_WARN()
and dev_WARN_ONCE()
Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D39049
This commit is contained in:
parent
99bd5c1fe3
commit
0777b000f1
@ -199,6 +199,20 @@ show_class_attr_string(struct class *class,
|
||||
#define dev_printk(lvl, dev, fmt, ...) \
|
||||
device_printf((dev)->bsddev, fmt, ##__VA_ARGS__)
|
||||
|
||||
#define dev_WARN(dev, fmt, ...) \
|
||||
device_printf((dev)->bsddev, "%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#define dev_WARN_ONCE(dev, condition, fmt, ...) do { \
|
||||
static bool __dev_WARN_ONCE; \
|
||||
bool __ret_warn_on = (condition); \
|
||||
if (unlikely(__ret_warn_on)) { \
|
||||
if (!__dev_WARN_ONCE) { \
|
||||
__dev_WARN_ONCE = true; \
|
||||
device_printf((dev)->bsddev, "%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define dev_info_once(dev, ...) do { \
|
||||
static bool __dev_info_once; \
|
||||
if (!__dev_info_once) { \
|
||||
|
Loading…
Reference in New Issue
Block a user