cfg80211: combine two nested ifs into a single condition

Combine two instances of having two nested if statements
into a single one with a combined condition to reduce the
indentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2017-02-13 20:53:38 +01:00
Родитель ae44b50266
Коммит d4f2997867
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -1216,12 +1216,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
*/ */
if ((wdev->iftype == NL80211_IFTYPE_STATION || if ((wdev->iftype == NL80211_IFTYPE_STATION ||
wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) &&
rdev->ops->set_power_mgmt) rdev->ops->set_power_mgmt &&
if (rdev_set_power_mgmt(rdev, dev, wdev->ps, rdev_set_power_mgmt(rdev, dev, wdev->ps,
wdev->ps_timeout)) { wdev->ps_timeout)) {
/* assume this means it's off */ /* assume this means it's off */
wdev->ps = false; wdev->ps = false;
} }
break; break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
/* /*

Просмотреть файл

@ -914,11 +914,11 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
netdev_err(dev, "failed to set key %d\n", i); netdev_err(dev, "failed to set key %d\n", i);
continue; continue;
} }
if (wdev->connect_keys->def == i) if (wdev->connect_keys->def == i &&
if (rdev_set_default_key(rdev, dev, i, true, true)) { rdev_set_default_key(rdev, dev, i, true, true)) {
netdev_err(dev, "failed to set defkey %d\n", i); netdev_err(dev, "failed to set defkey %d\n", i);
continue; continue;
} }
} }
kzfree(wdev->connect_keys); kzfree(wdev->connect_keys);