diff options
author | Johannes Berg <johannes.berg@intel.com> | 2020-07-30 15:52:13 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2020-07-31 09:27:02 +0200 |
commit | c8ad010665c0b85c6a35466b2159e907b8dd85d1 (patch) | |
tree | 126562ba3f0b47989db6e6aaf92226f146e84a98 /net/mac80211/driver-ops.h | |
parent | nl80211: support 4-way handshake offloading for WPA/WPA2-PSK in AP mode (diff) | |
download | linux-c8ad010665c0b85c6a35466b2159e907b8dd85d1.tar.xz linux-c8ad010665c0b85c6a35466b2159e907b8dd85d1.zip |
mac80211: warn only once in check_sdata_in_driver() at each caller
Ben Greear has repeatedly reported in the past (for a few years
probably) that this triggers repeatedly in certain scenarios.
Make this a macro so that each callsite can trigger the warning
only once - that will still give us an idea of what's going on
and what paths can reach it, but avoids being too noisy.
Link: https://lore.kernel.org/r/20200730155212.06fd3a95dbfb.I0b16829aabfaf5f642bce401502a29d16e2dd444@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index de69fc9c4f07..41d495d73d3a 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -12,12 +12,11 @@ #include "ieee80211_i.h" #include "trace.h" -static inline bool check_sdata_in_driver(struct ieee80211_sub_if_data *sdata) -{ - return !WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), - "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", - sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); -} +#define check_sdata_in_driver(sdata) ({ \ + !WARN_ONCE(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), \ + "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", \ + sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); \ +}) static inline struct ieee80211_sub_if_data * get_bss_sdata(struct ieee80211_sub_if_data *sdata) |