Commit 7a087e74 authored by Kirtika Ruchandani's avatar Kirtika Ruchandani Committed by Johannes Berg

nl80211: Fix checkpatch warnings about blank lines

This patch fixes the following checkpatch.pl issues -
- Please don't use multiple blank lines
- Blank lines aren't necessary before a close brace
- Missing a blank line after declarations
Reviewed-by: default avatarJulian Calaby <julian.calaby@gmail.com>
Signed-off-by: default avatarKirtika Ruchandani <kirtika.ruchandani@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 56ab364f
...@@ -167,6 +167,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs) ...@@ -167,6 +167,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
if (attrs[NL80211_ATTR_IFINDEX]) { if (attrs[NL80211_ATTR_IFINDEX]) {
int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]); int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]);
netdev = __dev_get_by_index(netns, ifindex); netdev = __dev_get_by_index(netns, ifindex);
if (netdev) { if (netdev) {
if (netdev->ieee80211_ptr) if (netdev->ieee80211_ptr)
...@@ -731,6 +732,7 @@ static int nl80211_parse_key_new(struct nlattr *key, struct key_parse *k) ...@@ -731,6 +732,7 @@ static int nl80211_parse_key_new(struct nlattr *key, struct key_parse *k)
if (tb[NL80211_KEY_DEFAULT_TYPES]) { if (tb[NL80211_KEY_DEFAULT_TYPES]) {
struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES];
err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1, err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1,
tb[NL80211_KEY_DEFAULT_TYPES], tb[NL80211_KEY_DEFAULT_TYPES],
nl80211_key_default_policy); nl80211_key_default_policy);
...@@ -1382,6 +1384,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, ...@@ -1382,6 +1384,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
rdev->ops->get_antenna) { rdev->ops->get_antenna) {
u32 tx_ant = 0, rx_ant = 0; u32 tx_ant = 0, rx_ant = 0;
int res; int res;
res = rdev_get_antenna(rdev, &tx_ant, &rx_ant); res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
if (!res) { if (!res) {
if (nla_put_u32(msg, if (nla_put_u32(msg,
...@@ -2157,7 +2160,6 @@ static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info) ...@@ -2157,7 +2160,6 @@ static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info)
return rdev_set_wds_peer(rdev, dev, bssid); return rdev_set_wds_peer(rdev, dev, bssid);
} }
static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
{ {
struct cfg80211_registered_device *rdev; struct cfg80211_registered_device *rdev;
...@@ -2292,6 +2294,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) ...@@ -2292,6 +2294,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] && if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) { info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
u32 tx_ant, rx_ant; u32 tx_ant, rx_ant;
if ((!rdev->wiphy.available_antennas_tx && if ((!rdev->wiphy.available_antennas_tx &&
!rdev->wiphy.available_antennas_rx) || !rdev->wiphy.available_antennas_rx) ||
!rdev->ops->set_antenna) !rdev->ops->set_antenna)
...@@ -2960,6 +2963,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -2960,6 +2963,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
pairwise = !!mac_addr; pairwise = !!mac_addr;
if (info->attrs[NL80211_ATTR_KEY_TYPE]) { if (info->attrs[NL80211_ATTR_KEY_TYPE]) {
u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]); u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
if (kt >= NUM_NL80211_KEYTYPES) if (kt >= NUM_NL80211_KEYTYPES)
return -EINVAL; return -EINVAL;
if (kt != NL80211_KEYTYPE_GROUP && if (kt != NL80211_KEYTYPE_GROUP &&
...@@ -4003,7 +4007,6 @@ static int nl80211_dump_station(struct sk_buff *skb, ...@@ -4003,7 +4007,6 @@ static int nl80211_dump_station(struct sk_buff *skb,
sta_idx++; sta_idx++;
} }
out: out:
cb->args[2] = sta_idx; cb->args[2] = sta_idx;
err = skb->len; err = skb->len;
...@@ -4804,7 +4807,6 @@ static int nl80211_dump_mpath(struct sk_buff *skb, ...@@ -4804,7 +4807,6 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
path_idx++; path_idx++;
} }
out: out:
cb->args[2] = path_idx; cb->args[2] = path_idx;
err = skb->len; err = skb->len;
...@@ -5094,7 +5096,6 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info) ...@@ -5094,7 +5096,6 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
enum nl80211_user_reg_hint_type user_reg_hint_type; enum nl80211_user_reg_hint_type user_reg_hint_type;
u32 owner_nlportid; u32 owner_nlportid;
/* /*
* You should only get this when cfg80211 hasn't yet initialized * You should only get this when cfg80211 hasn't yet initialized
* completely when built-in to the kernel right between the time * completely when built-in to the kernel right between the time
...@@ -5303,7 +5304,6 @@ do { \ ...@@ -5303,7 +5304,6 @@ do { \
} \ } \
} while (0) } while (0)
if (!info->attrs[NL80211_ATTR_MESH_CONFIG]) if (!info->attrs[NL80211_ATTR_MESH_CONFIG])
return -EINVAL; return -EINVAL;
if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX, if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX,
...@@ -5450,7 +5450,6 @@ static int nl80211_parse_mesh_setup(struct genl_info *info, ...@@ -5450,7 +5450,6 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
IEEE80211_PATH_METRIC_VENDOR : IEEE80211_PATH_METRIC_VENDOR :
IEEE80211_PATH_METRIC_AIRTIME; IEEE80211_PATH_METRIC_AIRTIME;
if (tb[NL80211_MESH_SETUP_IE]) { if (tb[NL80211_MESH_SETUP_IE]) {
struct nlattr *ieattr = struct nlattr *ieattr =
tb[NL80211_MESH_SETUP_IE]; tb[NL80211_MESH_SETUP_IE];
...@@ -6074,6 +6073,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) ...@@ -6074,6 +6073,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
/* all channels */ /* all channels */
for (band = 0; band < NUM_NL80211_BANDS; band++) { for (band = 0; band < NUM_NL80211_BANDS; band++) {
int j; int j;
if (!wiphy->bands[band]) if (!wiphy->bands[band])
continue; continue;
for (j = 0; j < wiphy->bands[band]->n_channels; j++) { for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
...@@ -6483,6 +6483,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -6483,6 +6483,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
/* all channels */ /* all channels */
for (band = 0; band < NUM_NL80211_BANDS; band++) { for (band = 0; band < NUM_NL80211_BANDS; band++) {
int j; int j;
if (!wiphy->bands[band]) if (!wiphy->bands[band])
continue; continue;
for (j = 0; j < wiphy->bands[band]->n_channels; j++) { for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
...@@ -7245,6 +7246,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info) ...@@ -7245,6 +7246,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
if (key.idx >= 0) { if (key.idx >= 0) {
int i; int i;
bool ok = false; bool ok = false;
for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) { for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
if (key.p.cipher == rdev->wiphy.cipher_suites[i]) { if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
ok = true; ok = true;
...@@ -7323,6 +7325,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, ...@@ -7323,6 +7325,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) { if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) {
u16 proto; u16 proto;
proto = nla_get_u16( proto = nla_get_u16(
info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]); info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]);
settings->control_port_ethertype = cpu_to_be16(proto); settings->control_port_ethertype = cpu_to_be16(proto);
...@@ -8476,6 +8479,7 @@ static u32 rateset_to_mask(struct ieee80211_supported_band *sband, ...@@ -8476,6 +8479,7 @@ static u32 rateset_to_mask(struct ieee80211_supported_band *sband,
for (i = 0; i < rates_len; i++) { for (i = 0; i < rates_len; i++) {
int rate = (rates[i] & 0x7f) * 5; int rate = (rates[i] & 0x7f) * 5;
int ridx; int ridx;
for (ridx = 0; ridx < sband->n_bitrates; ridx++) { for (ridx = 0; ridx < sband->n_bitrates; ridx++) {
struct ieee80211_rate *srate = struct ieee80211_rate *srate =
&sband->bitrates[ridx]; &sband->bitrates[ridx];
...@@ -8784,7 +8788,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) ...@@ -8784,7 +8788,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME || if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
params.wait > rdev->wiphy.max_remain_on_channel_duration) params.wait > rdev->wiphy.max_remain_on_channel_duration)
return -EINVAL; return -EINVAL;
} }
params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK]; params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
...@@ -10631,7 +10634,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb) ...@@ -10631,7 +10634,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
} }
EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply); EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
static int nl80211_set_qos_map(struct sk_buff *skb, static int nl80211_set_qos_map(struct sk_buff *skb,
struct genl_info *info) struct genl_info *info)
{ {
...@@ -12170,7 +12172,6 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev, ...@@ -12170,7 +12172,6 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
nla_put_failure: nla_put_failure:
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
nlmsg_free(msg); nlmsg_free(msg);
} }
void nl80211_send_roamed(struct cfg80211_registered_device *rdev, void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
...@@ -12209,7 +12210,6 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev, ...@@ -12209,7 +12210,6 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
nla_put_failure: nla_put_failure:
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
nlmsg_free(msg); nlmsg_free(msg);
} }
void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
...@@ -12247,7 +12247,6 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, ...@@ -12247,7 +12247,6 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
nla_put_failure: nla_put_failure:
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
nlmsg_free(msg); nlmsg_free(msg);
} }
void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
...@@ -13589,7 +13588,6 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) ...@@ -13589,7 +13588,6 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
if (hdr) if (hdr)
genlmsg_cancel(msg, hdr); genlmsg_cancel(msg, hdr);
nlmsg_free(msg); nlmsg_free(msg);
} }
EXPORT_SYMBOL(cfg80211_crit_proto_stopped); EXPORT_SYMBOL(cfg80211_crit_proto_stopped);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment