diff options
author | 2025-01-02 16:20:02 +0200 | |
---|---|---|
committer | 2025-01-13 15:34:09 +0100 | |
commit | bb54c93bd37541424505281e09fffe75ab3357e9 (patch) | |
tree | 2d8deddd62f9cf2157f04e039802f388e6d041ff /net/wireless | |
parent | wifi: mac80211: Support parsing EPCS ML element (diff) | |
download | linux-rng-bb54c93bd37541424505281e09fffe75ab3357e9.tar.xz linux-rng-bb54c93bd37541424505281e09fffe75ab3357e9.zip |
wifi: nl80211: simplify nested if checks
In the absence of (an) else clause(s), "if (a) if (b)" is
equivalent to "if (a && b)", so simplify the code a bit.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.c8bf7338aa64.Ie49dcc1ba44b507d91d5a9d8bd538d7ac2e46c54@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 351b863623af..d7d3da0f6833 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -18537,10 +18537,9 @@ void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev, nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer_addr)) goto nla_put_failure; - if ((td_bitmap_len > 0) && td_bitmap) - if (nla_put(msg, NL80211_ATTR_TD_BITMAP, - td_bitmap_len, td_bitmap)) - goto nla_put_failure; + if (td_bitmap_len > 0 && td_bitmap && + nla_put(msg, NL80211_ATTR_TD_BITMAP, td_bitmap_len, td_bitmap)) + goto nla_put_failure; genlmsg_end(msg, hdr); |