mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
Bluetooth: Adding a bt_dev_warn_ratelimited macro.
The macro will be used to display rate limited warning messages in the log. Signed-off-by: Alain Michaud <alainm@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
3c85efb8f1
commit
36278a5d4d
@ -129,6 +129,8 @@ void bt_warn(const char *fmt, ...);
|
||||
__printf(1, 2)
|
||||
void bt_err(const char *fmt, ...);
|
||||
__printf(1, 2)
|
||||
void bt_warn_ratelimited(const char *fmt, ...);
|
||||
__printf(1, 2)
|
||||
void bt_err_ratelimited(const char *fmt, ...);
|
||||
|
||||
#define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__)
|
||||
@ -147,6 +149,8 @@ void bt_err_ratelimited(const char *fmt, ...);
|
||||
#define bt_dev_dbg(hdev, fmt, ...) \
|
||||
BT_DBG("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
|
||||
|
||||
#define bt_dev_warn_ratelimited(hdev, fmt, ...) \
|
||||
bt_warn_ratelimited("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
|
||||
#define bt_dev_err_ratelimited(hdev, fmt, ...) \
|
||||
BT_ERR_RATELIMITED("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
|
||||
|
||||
|
@ -183,6 +183,22 @@ void bt_err(const char *format, ...)
|
||||
}
|
||||
EXPORT_SYMBOL(bt_err);
|
||||
|
||||
void bt_warn_ratelimited(const char *format, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
vaf.fmt = format;
|
||||
vaf.va = &args;
|
||||
|
||||
pr_warn_ratelimited("%pV", &vaf);
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
EXPORT_SYMBOL(bt_warn_ratelimited);
|
||||
|
||||
void bt_err_ratelimited(const char *format, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
|
Loading…
Reference in New Issue
Block a user