mac80211: Convert WARN_ON to WARN_ON_ONCE
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 6 Apr 2012 21:35:53 +0000 (16:35 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Apr 2012 19:54:48 +0000 (15:54 -0400)
When the control-rate tables are not set up correctly, it makes
little sense to spam the logs, thus change the WARN_ON to WARN_ON_ONCE.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/mac80211.h

index 87d203ff7a8ad4d43ae97bcd91116529934b4ef7..9210bdc7bd8d417b94cf721b9ac671f7f2e700ed 100644 (file)
@@ -1327,7 +1327,7 @@ static inline struct ieee80211_rate *
 ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
                      const struct ieee80211_tx_info *c)
 {
-       if (WARN_ON(c->control.rates[0].idx < 0))
+       if (WARN_ON_ONCE(c->control.rates[0].idx < 0))
                return NULL;
        return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx];
 }