OSDN Git Service

rt2x00: use ratelimited variants dev_warn/dev_err
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 12 Mar 2019 09:51:41 +0000 (10:51 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 25 Apr 2019 16:40:52 +0000 (19:40 +0300)
As reported by Randy we can overwhelm logs on some USB error conditions.
To avoid that use dev_warn_ratelimited() and dev_err_ratelimitd().

Reported-and-tested-by: Randy Oostdyk <linux-kernel@oostdyk.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2x00.h

index 50b92ca..ebe4c7f 100644 (file)
        printk(KERN_ERR KBUILD_MODNAME ": %s: Error - " fmt,            \
               __func__, ##__VA_ARGS__)
 #define rt2x00_err(dev, fmt, ...)                                      \
-       wiphy_err((dev)->hw->wiphy, "%s: Error - " fmt,                 \
+       wiphy_err_ratelimited((dev)->hw->wiphy, "%s: Error - " fmt,     \
                  __func__, ##__VA_ARGS__)
 #define rt2x00_warn(dev, fmt, ...)                                     \
-       wiphy_warn((dev)->hw->wiphy, "%s: Warning - " fmt,              \
+       wiphy_warn_ratelimited((dev)->hw->wiphy, "%s: Warning - " fmt,  \
                   __func__, ##__VA_ARGS__)
 #define rt2x00_info(dev, fmt, ...)                                     \
        wiphy_info((dev)->hw->wiphy, "%s: Info - " fmt,                 \