From patchwork Mon May 30 02:53:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirtika Ruchandani X-Patchwork-Id: 9140165 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 716AF607DA for ; Mon, 30 May 2016 02:53:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D5EC20265 for ; Mon, 30 May 2016 02:53:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2245D281FF; Mon, 30 May 2016 02:53:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34F3A20265 for ; Mon, 30 May 2016 02:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbcE3CxP (ORCPT ); Sun, 29 May 2016 22:53:15 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33001 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbcE3CxN (ORCPT ); Sun, 29 May 2016 22:53:13 -0400 Received: by mail-pa0-f67.google.com with SMTP id f8so20083976pag.0; Sun, 29 May 2016 19:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xPhDrtHnKrJ05c/JmxIdksoiZHLgwkhwaJRJY6Cx318=; b=bNlxPxHJwpSqf+AY0KGKquKO3KLCM0mf/O8pRT9MQcCVx30yoTQS+3Opu1G+0aZpMx ezBYxJwIPdxx2D+lWMjqoOUFkyB/ovG5ojjixLWRINRrhin+oCCAbLAkSz6zrykk3vKw fnllqpCEuGPifMzUr2FC7aDmbPFC7/RXpRwjB60Ci/I16fzYB8byZdtwlAOiOvmlZt2B 7SH/+AHZ8Vdr7YUHKIwyABrKfA1Hs5Rzpkh752x5GlzgOhrx4ywcjztRP8ztHmuayicm DVy2O+ZqCEZoPEPGAoDDM2zX8ZbGcP1Lk55ThemFWqpvAipz29ngZWiTtnbL7uwW67f/ ZBsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xPhDrtHnKrJ05c/JmxIdksoiZHLgwkhwaJRJY6Cx318=; b=gTfJHVepUnneS7tsH+ynm1Wn9w3qbgZsCBARL63OpNtXu8/anuugVcYndAUVlQ31um X60KHyljHiFUYGRFdjmXviCR19sDGZ+TyU8/GlRzm42U0WbEkCtZCYhOK44uB3disMCM 3a6PAWbuEotoDFKUAtmbxMRnErPLSK6ecwGq0bTUBeCSQjfTm6D/azmnYUpmkCBLrUa4 zwiqpOHM6HBQDlFKUaqw9QV9xzuLFH9U0L1Zw3zrpjRe/8AnmpEwxWzK431pVqTzkz5g oRK7ifx823RHaTG7/Z69+nTHPG7JRytHd85gF77s7AiNiE/VYPzfIksZleCGdppA9Gvm BzwA== X-Gm-Message-State: ALyK8tL7sP2nezyW3wnuV4i7Yyt8lNQU1KvPAwqZrifmZLtPKz1b4ITFwV9O9mrbLO+mqw== X-Received: by 10.66.77.165 with SMTP id t5mr42774502paw.61.1464576792299; Sun, 29 May 2016 19:53:12 -0700 (PDT) Received: from google.com ([2620:0:1000:1301:9988:7148:7bd6:87cc]) by smtp.gmail.com with ESMTPSA id a19sm28503652pfc.57.2016.05.29.19.53.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 19:53:11 -0700 (PDT) Date: Sun, 29 May 2016 19:53:06 -0700 From: Kirtika Ruchandani To: Johannes Berg Cc: linux-wireless@vger.kernel.org, ruchandani.tina@gmail.com, netdev@vger.kernel.org, Julian.Calaby@gmail.com Subject: [PATCH v2 06/10] nl80211: Various checkpatch.pl spacing fixes Message-ID: <80c4512b4c5ca1f26ecda9785a456c4d0cf4f937.1464576022.git.kirtika.ruchandani@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the following spacing issues reported by checkpatch.pl - - space preferred around that - no space needed after cast. - Alignment should match open parenthesis - suspect code indent for conditional statements - Statements should start on a tabstop This patch also contains two hunks to fix 'line over 80 characters', that are spacing related. All other instances of that warning have been ignored. Signed-off-by: Kirtika Ruchandani Reviewed-by: Julian Calaby --- net/wireless/nl80211.c | 103 ++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 49 deletions(-) -- 2.8.0.rc3.226.g39d4020 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 11cbf0b..ad7cdce 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -39,10 +39,10 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, /* the netlink family */ static struct genl_family nl80211_fam = { - .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ - .name = NL80211_GENL_NAME, /* have users key off the name instead */ - .hdrsize = 0, /* no private header */ - .version = 1, /* no particular meaning now */ + .id = GENL_ID_GENERATE, /* don't bother with a hardcoded ID */ + .name = NL80211_GENL_NAME, /* have users key off the name instead */ + .hdrsize = 0, /* no private header */ + .version = 1, /* no particular meaning now */ .maxattr = NL80211_ATTR_MAX, .netnsok = true, .pre_doit = nl80211_pre_doit, @@ -213,7 +213,7 @@ cfg80211_get_dev_from_info(struct net *netns, struct genl_info *info) static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, [NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING, - .len = 20-1 }, + .len = 20 - 1 }, [NL80211_ATTR_WIPHY_TXQ_PARAMS] = { .type = NLA_NESTED }, [NL80211_ATTR_WIPHY_FREQ] = { .type = NLA_U32 }, @@ -231,7 +231,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, - [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, + [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ - 1 }, [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, @@ -967,7 +967,7 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy, int i, j; nl_combis = nla_nest_start(msg, - NL80211_ATTR_INTERFACE_COMBINATIONS); + NL80211_ATTR_INTERFACE_COMBINATIONS); if (!nl_combis) goto nla_put_failure; @@ -1012,9 +1012,9 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy, goto nla_put_failure; if (large && (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, - c->radar_detect_widths) || + c->radar_detect_widths) || nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, - c->radar_detect_regions))) + c->radar_detect_regions))) goto nla_put_failure; nla_nest_end(msg, nl_combi); @@ -1493,7 +1493,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, i = 0; #define CMD(op, n) \ - do { \ + do { \ if (rdev->ops->op) { \ i++; \ if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \ @@ -1735,8 +1735,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, rdev->wiphy.max_num_csa_counters)) goto nla_put_failure; - if (rdev->wiphy.regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED && - nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) + if ((rdev->wiphy.regulatory_flags & + REGULATORY_WIPHY_SELF_MANAGED) && + nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) goto nla_put_failure; if (nla_put(msg, NL80211_ATTR_EXT_FEATURES, @@ -2299,7 +2300,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) if (frag_threshold < 256) return -EINVAL; - if (frag_threshold != (u32) -1) { + if (frag_threshold != (u32)-1) { /* Fragments (apart from the last one) are required to * have even length. Make the fragmentation code * simpler by stripping LSB should someone try to use @@ -2406,7 +2407,8 @@ static int nl80211_send_chandef(struct sk_buff *msg, return 0; } -static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, +static int nl80211_send_iface(struct sk_buff *msg, + u32 portid, u32 seq, int flags, struct cfg80211_registered_device *rdev, struct wireless_dev *wdev, bool removal) { @@ -2470,7 +2472,8 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag return -EMSGSIZE; } -static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *cb) +static int nl80211_dump_interface(struct sk_buff *skb, + struct netlink_callback *cb) { int wp_idx = 0; int if_idx = 0; @@ -2557,7 +2560,7 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags) for (flag = 1; flag <= NL80211_MNTR_FLAG_MAX; flag++) if (flags[flag]) - *mntrflags |= (1<attrs[NL80211_ATTR_IFNAME]), - NET_NAME_USER, type, err ? NULL : &flags, - ¶ms); + nla_data(info->attrs[NL80211_ATTR_IFNAME]), + NET_NAME_USER, type, err ? NULL : &flags, + ¶ms); if (WARN_ON(!wdev)) { nlmsg_free(msg); return -EPROTO; @@ -3000,7 +3003,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info) goto out; err = rdev_set_default_key(rdev, dev, key.idx, - key.def_uni, key.def_multi); + key.def_uni, key.def_multi); if (err) goto out; @@ -3621,7 +3624,7 @@ static int parse_station_flags(struct genl_info *info, for (flag = 1; flag <= NL80211_STA_FLAG_MAX; flag++) { if (flags[flag]) { - params->sta_flags_set |= (1<sta_flags_set |= (1 << flag); /* no longer support new API additions in old API */ if (flag > NL80211_STA_FLAG_MAX_OLD_API) @@ -3949,10 +3952,10 @@ static int nl80211_dump_station(struct sk_buff *skb, goto out_err; if (nl80211_send_station(skb, NL80211_CMD_NEW_STATION, - NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, NLM_F_MULTI, - rdev, wdev->netdev, mac_addr, - &sinfo) < 0) + NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, NLM_F_MULTI, + rdev, wdev->netdev, mac_addr, + &sinfo) < 0) goto out; sta_idx++; @@ -4224,7 +4227,7 @@ static int nl80211_parse_sta_wme(struct genl_info *info, } static int nl80211_parse_sta_channel_info(struct genl_info *info, - struct station_parameters *params) + struct station_parameters *params) { if (info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]) { params->supported_channels = @@ -4655,9 +4658,9 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) } static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, - int flags, struct net_device *dev, - u8 *dst, u8 *next_hop, - struct mpath_info *pinfo) + int flags, struct net_device *dev, + u8 *dst, u8 *next_hop, + struct mpath_info *pinfo) { void *hdr; struct nlattr *pinfoattr; @@ -4790,7 +4793,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info) return -ENOMEM; if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, - dev, dst, next_hop, &pinfo) < 0) { + dev, dst, next_hop, &pinfo) < 0) { nlmsg_free(msg); return -ENOBUFS; } @@ -5185,7 +5188,8 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, return -ENOBUFS; } -static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_ATTR_MAX+1] = { +static const +struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_ATTR_MAX + 1] = { [NL80211_MESHCONF_RETRY_TIMEOUT] = { .type = NLA_U16 }, [NL80211_MESHCONF_CONFIRM_TIMEOUT] = { .type = NLA_U16 }, [NL80211_MESHCONF_HOLDING_TIMEOUT] = { .type = NLA_U16 }, @@ -5217,7 +5221,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A }; static const struct nla_policy - nl80211_mesh_setup_params_policy[NL80211_MESH_SETUP_ATTR_MAX+1] = { + nl80211_mesh_setup_params_policy[NL80211_MESH_SETUP_ATTR_MAX + 1] = { [NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC] = { .type = NLA_U8 }, [NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 }, [NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 }, @@ -5363,7 +5367,7 @@ do { \ } static int nl80211_parse_mesh_setup(struct genl_info *info, - struct mesh_setup *setup) + struct mesh_setup *setup) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct nlattr *tb[NL80211_MESH_SETUP_ATTR_MAX + 1]; @@ -5672,7 +5676,7 @@ static const struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] = }; static int parse_reg_rule(struct nlattr *tb[], - struct ieee80211_reg_rule *reg_rule) + struct ieee80211_reg_rule *reg_rule) { struct ieee80211_freq_range *freq_range = ®_rule->freq_range; struct ieee80211_power_rule *power_rule = ®_rule->power_rule; @@ -6686,7 +6690,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) /* csa_attrs is defined static to avoid waste of stack size - this * function is called under RTNL lock, so this should not be a problem. */ - static struct nlattr *csa_attrs[NL80211_ATTR_MAX+1]; + static struct nlattr *csa_attrs[NL80211_ATTR_MAX + 1]; int err; bool need_new_beacon = false; int len, i; @@ -6982,8 +6986,8 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) if (++idx <= start) continue; if (nl80211_send_bss(skb, cb, - cb->nlh->nlmsg_seq, NLM_F_MULTI, - rdev, wdev, scan) < 0) { + cb->nlh->nlmsg_seq, NLM_F_MULTI, + rdev, wdev, scan) < 0) { idx--; break; } @@ -7035,7 +7039,7 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, goto nla_put_failure; if ((survey->filled & SURVEY_INFO_TIME) && nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME, - survey->time, NL80211_SURVEY_INFO_PAD)) + survey->time, NL80211_SURVEY_INFO_PAD)) goto nla_put_failure; if ((survey->filled & SURVEY_INFO_TIME_BUSY) && nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_BUSY, @@ -7109,9 +7113,9 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) } if (nl80211_send_survey(skb, - NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, NLM_F_MULTI, - wdev->netdev, radio_stats, &survey) < 0) + NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, NLM_F_MULTI, + wdev->netdev, radio_stats, &survey) < 0) goto out; survey_idx++; } @@ -7674,8 +7678,8 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) bool no_ht = false; connkeys = nl80211_parse_connkeys(rdev, - info->attrs[NL80211_ATTR_KEYS], - &no_ht); + info->attrs[NL80211_ATTR_KEYS], + &no_ht); if (IS_ERR(connkeys)) return PTR_ERR(connkeys); @@ -8022,7 +8026,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) connect.bg_scan_period = -1; if (info->attrs[NL80211_ATTR_BG_SCAN_PERIOD] && - (wiphy->flags & WIPHY_FLAG_SUPPORTS_FW_ROAM)) { + (wiphy->flags & WIPHY_FLAG_SUPPORTS_FW_ROAM)) { connect.bg_scan_period = nla_get_u16(info->attrs[NL80211_ATTR_BG_SCAN_PERIOD]); } @@ -8067,7 +8071,8 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) if (connect.privacy && info->attrs[NL80211_ATTR_KEYS]) { connkeys = nl80211_parse_connkeys(rdev, - info->attrs[NL80211_ATTR_KEYS], NULL); + info->attrs[NL80211_ATTR_KEYS], + NULL); if (IS_ERR(connkeys)) return PTR_ERR(connkeys); } @@ -9046,7 +9051,7 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) if (info->attrs[NL80211_ATTR_MCAST_RATE] && !nl80211_parse_mcast_rate(rdev, setup.mcast_rate, nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]))) - return -EINVAL; + return -EINVAL; if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { setup.beacon_interval = @@ -12234,7 +12239,7 @@ void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr, nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || (ie_len && ie && - nla_put(msg, NL80211_ATTR_IE, ie_len , ie))) + nla_put(msg, NL80211_ATTR_IE, ie_len, ie))) goto nla_put_failure; genlmsg_end(msg, hdr); @@ -12958,7 +12963,7 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, if ((notif == NL80211_CMD_CH_SWITCH_STARTED_NOTIFY) && (nla_put_u32(msg, NL80211_ATTR_CH_SWITCH_COUNT, count))) - goto nla_put_failure; + goto nla_put_failure; genlmsg_end(msg, hdr); @@ -13297,7 +13302,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, if (wakeup->net_detect && cfg80211_net_detect_results(msg, wakeup)) - goto free_msg; + goto free_msg; nla_nest_end(msg, reasons); }