Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: reduce indentation by inlining a check

Instead of nesting two if statements, inline the second
check into the first if statement and to indentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+20 -24
+20 -24
net/mac80211/mlme.c
··· 3437 3437 len - baselen, false, &elems, 3438 3438 care_about_ies, ncrc); 3439 3439 3440 - if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK)) { 3441 - bool directed_tim = ieee80211_check_tim(elems.tim, 3442 - elems.tim_len, 3443 - ifmgd->aid); 3444 - if (directed_tim) { 3445 - if (local->hw.conf.dynamic_ps_timeout > 0) { 3446 - if (local->hw.conf.flags & IEEE80211_CONF_PS) { 3447 - local->hw.conf.flags &= ~IEEE80211_CONF_PS; 3448 - ieee80211_hw_config(local, 3449 - IEEE80211_CONF_CHANGE_PS); 3450 - } 3451 - ieee80211_send_nullfunc(local, sdata, 0); 3452 - } else if (!local->pspolling && sdata->u.mgd.powersave) { 3453 - local->pspolling = true; 3454 - 3455 - /* 3456 - * Here is assumed that the driver will be 3457 - * able to send ps-poll frame and receive a 3458 - * response even though power save mode is 3459 - * enabled, but some drivers might require 3460 - * to disable power save here. This needs 3461 - * to be investigated. 3462 - */ 3463 - ieee80211_send_pspoll(local, sdata); 3440 + if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK) && 3441 + ieee80211_check_tim(elems.tim, elems.tim_len, ifmgd->aid)) { 3442 + if (local->hw.conf.dynamic_ps_timeout > 0) { 3443 + if (local->hw.conf.flags & IEEE80211_CONF_PS) { 3444 + local->hw.conf.flags &= ~IEEE80211_CONF_PS; 3445 + ieee80211_hw_config(local, 3446 + IEEE80211_CONF_CHANGE_PS); 3464 3447 } 3448 + ieee80211_send_nullfunc(local, sdata, 0); 3449 + } else if (!local->pspolling && sdata->u.mgd.powersave) { 3450 + local->pspolling = true; 3451 + 3452 + /* 3453 + * Here is assumed that the driver will be 3454 + * able to send ps-poll frame and receive a 3455 + * response even though power save mode is 3456 + * enabled, but some drivers might require 3457 + * to disable power save here. This needs 3458 + * to be investigated. 3459 + */ 3460 + ieee80211_send_pspoll(local, sdata); 3465 3461 } 3466 3462 } 3467 3463