提交 de4fcbad 编写于 作者: J Johannes Berg

cfg80211: avoid using default in interface type switch

Most code avoids having a default case in interface type switch
statements already, to make it easier to find places that need
to be extended. Change the code in the __cfg80211_leave() and
nl80211_key_allowed() functions to not have a default case.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 579a05f2
...@@ -869,7 +869,19 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev, ...@@ -869,7 +869,19 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_GO:
__cfg80211_stop_ap(rdev, dev, true); __cfg80211_stop_ap(rdev, dev, true);
break; break;
default: case NL80211_IFTYPE_WDS:
/* must be handled by mac80211/driver, has no APIs */
break;
case NL80211_IFTYPE_P2P_DEVICE:
/* cannot happen, has no netdev */
break;
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_MONITOR:
/* nothing to do */
break;
case NL80211_IFTYPE_UNSPECIFIED:
case NUM_NL80211_IFTYPES:
/* invalid */
break; break;
} }
} }
......
...@@ -884,7 +884,11 @@ static int nl80211_key_allowed(struct wireless_dev *wdev) ...@@ -884,7 +884,11 @@ static int nl80211_key_allowed(struct wireless_dev *wdev)
if (!wdev->current_bss) if (!wdev->current_bss)
return -ENOLINK; return -ENOLINK;
break; break;
default: case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_P2P_DEVICE:
case NL80211_IFTYPE_WDS:
case NUM_NL80211_IFTYPES:
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册