diff options
author | Alain Michaud <alainm@chromium.org> | 2019-12-11 02:54:43 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-01-04 10:41:03 +0100 |
commit | 36278a5d4d354e5d5610aa728831db9e03cc3d8d (patch) | |
tree | 7ecd008a7cc79721dbc372c6c7cb1599982babc9 /net/bluetooth/lib.c | |
parent | bna: remove set but not used variable 'pgoff' (diff) | |
download | linux-36278a5d4d354e5d5610aa728831db9e03cc3d8d.tar.xz linux-36278a5d4d354e5d5610aa728831db9e03cc3d8d.zip |
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>
Diffstat (limited to 'net/bluetooth/lib.c')
-rw-r--r-- | net/bluetooth/lib.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c index 63e65d9b4b24..c09e0a3a0ed9 100644 --- a/net/bluetooth/lib.c +++ b/net/bluetooth/lib.c @@ -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; |