diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:15 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:15 +0200 |
commit | e0f1115ebb757cebbc0cf7dd92a586e3dad19b77 (patch) | |
tree | f694ff849990cbfa962f49954266b5aa6eadf7eb /include/linux/printk.h | |
parent | d5a06d4800305af6740cde3894d8f4b65b26b392 (diff) | |
parent | 0a73158341d5d3ef1e79e0d77a177121ef502930 (diff) | |
download | barebox-e0f1115ebb757cebbc0cf7dd92a586e3dad19b77.tar.gz |
Merge branch 'for-next/usb'
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index a9d1b05f6f..42c29e04dd 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -205,4 +205,17 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \ print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true) +#define dev_WARN_ONCE(dev, condition, format...) ({ \ + static int __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once)) { \ + if (!__warned) { \ + __warned = 1; \ + dev_warn(dev, format); \ + } \ + } \ + unlikely(__ret_warn_once); \ +}) + #endif |