Skip to content

Commit bb54c93

Browse files
committed
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 <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250102161730.c8bf7338aa64.Ie49dcc1ba44b507d91d5a9d8bd538d7ac2e46c54@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 24711d6 commit bb54c93

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

net/wireless/nl80211.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18537,10 +18537,9 @@ void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
1853718537
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer_addr))
1853818538
goto nla_put_failure;
1853918539

18540-
if ((td_bitmap_len > 0) && td_bitmap)
18541-
if (nla_put(msg, NL80211_ATTR_TD_BITMAP,
18542-
td_bitmap_len, td_bitmap))
18543-
goto nla_put_failure;
18540+
if (td_bitmap_len > 0 && td_bitmap &&
18541+
nla_put(msg, NL80211_ATTR_TD_BITMAP, td_bitmap_len, td_bitmap))
18542+
goto nla_put_failure;
1854418543

1854518544
genlmsg_end(msg, hdr);
1854618545

0 commit comments

Comments
 (0)