All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] nl80211: Fix checkpatch.pl issues
@ 2016-05-29  3:30 Kirtika Ruchandani
  2016-05-29  3:30   ` Kirtika Ruchandani
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-29  3:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ruchandani.tina, netdev

This patch-set attempts to fix checkpatch.pl issues found in nl80211.c. 
Each patch describes the specific warnings/checks/errors it addresses. 
This patch-set ignores 'line over 80 chars' warnings.
Please check for issues with the 'fixes' for 'alignment should match 
open parenthesis'. Some of them do not display correctly with git diff.
This patch-set removes 3 errors, 66 warnings and 46 checks. 

Kirtika Ruchandani (3):
  nl80211: Fix checkpatch warnings
  nl80211: Fix checkpatch warnings about blank lines
  nl80211:  Various checkpatch.pl fixes

 net/wireless/nl80211.c | 303 ++++++++++++++++++++++---------------------------
 1 file changed, 137 insertions(+), 166 deletions(-)

-- 
2.8.0.rc3.226.g39d4020


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/3] nl80211: Fix checkpatch warnings
@ 2016-05-29  3:30   ` Kirtika Ruchandani
  0 siblings, 0 replies; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-29  3:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ruchandani.tina, netdev

This patch fixes the following checkpatch.pl warnings about
comments in nl80211.c :
- networking block comments don't use an empty '/*' line
- block comments use a trailing '*/' on a separate line

Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>
---
 net/wireless/nl80211.c | 129 +++++++++++++++++--------------------------------
 1 file changed, 45 insertions(+), 84 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d759901..50a0de0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -196,8 +196,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
 	return rdev;
 }
 
-/*
- * This function returns a pointer to the driver
+/* This function returns a pointer to the driver
  * that the genl_info item that is passed refers to.
  *
  * The result of this can be a PTR_ERR and hence must
@@ -1624,8 +1623,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 			goto nla_put_failure;
 
 		features = rdev->wiphy.features;
-		/*
-		 * We can only add the per-channel limit information if the
+		/* We can only add the per-channel limit information if the
 		 * dump is split, otherwise it makes it too big. Therefore
 		 * only advertise it in that case.
 		 */
@@ -1646,8 +1644,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 				rdev->wiphy.max_acl_mac_addrs))
 			goto nla_put_failure;
 
-		/*
-		 * Any information below this point is only available to
+		/* Any information below this point is only available to
 		 * applications that can deal with it being split. This
 		 * helps ensure that newly added capabilities don't break
 		 * older tools by overrunning their buffers.
@@ -1847,8 +1844,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
 						 cb->nlh->nlmsg_seq,
 						 NLM_F_MULTI, state);
 			if (ret < 0) {
-				/*
-				 * If sending the wiphy data didn't fit (ENOBUFS
+				/* If sending the wiphy data didn't fit (ENOBUFS
 				 * or EMSGSIZE returned), this SKB is still
 				 * empty (so it's not too big because another
 				 * wiphy dataset is already in the skb) and
@@ -1937,8 +1933,7 @@ static int parse_txq_params(struct nlattr *tb[],
 
 static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev)
 {
-	/*
-	 * You can only set the channel explicitly for WDS interfaces,
+	/* You can only set the channel explicitly for WDS interfaces,
 	 * all others have their channel managed via their respective
 	 * "establish a connection" command (connect, join, ...)
 	 *
@@ -2131,8 +2126,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 
 	ASSERT_RTNL();
 
-	/*
-	 * Try to find the wiphy and netdev. Normally this
+	/* Try to find the wiphy and netdev. Normally this
 	 * function shouldn't need the netdev, but this is
 	 * done for backward compatibility -- previously
 	 * setting the channel was done per wiphy, but now
@@ -2162,8 +2156,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 	} else
 		wdev = netdev->ieee80211_ptr;
 
-	/*
-	 * end workaround code, by now the rdev is available
+	/* end workaround code, by now the rdev is available
 	 * and locked, and wdev may or may not be NULL.
 	 */
 
@@ -2260,7 +2253,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]);
 
 		/* reject antenna configurations which don't match the
-		 * available antenna masks, except for the "all" mask */
+		 * available antenna masks, except for the "all" mask
+		 */
 		if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
 		    (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx)))
 			return -EINVAL;
@@ -2300,8 +2294,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 
 		if (frag_threshold != (u32) -1) {
-			/*
-			 * Fragments (apart from the last one) are required to
+			/* 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
 			 * odd threshold value.
@@ -2751,8 +2744,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 		wdev_unlock(wdev);
 		break;
 	case NL80211_IFTYPE_P2P_DEVICE:
-		/*
-		 * P2P Device doesn't have a netdev, so doesn't go
+		/* P2P Device doesn't have a netdev, so doesn't go
 		 * through the netdev notifier and must be added here
 		 */
 		mutex_init(&wdev->mtx);
@@ -2808,8 +2800,7 @@ static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
 		msg = NULL;
 	}
 
-	/*
-	 * If we remove a wireless device without a netdev then clear
+	/* If we remove a wireless device without a netdev then clear
 	 * user_ptr[1] so that nl80211_post_doit won't dereference it
 	 * to check if it needs to do dev_put(). Otherwise it crashes
 	 * since the wdev has been freed, unlike with a netdev where
@@ -3160,8 +3151,7 @@ static int validate_acl_mac_addrs(struct nlattr *nl_attr)
 	return n_entries;
 }
 
-/*
- * This function parses ACL information and allocates memory for ACL data.
+/* This function parses ACL information and allocates memory for ACL data.
  * On successful return, the calling function is responsible to free the
  * ACL buffer returned by this function.
  */
@@ -3377,8 +3367,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 	if (err)
 		return err;
 
-	/*
-	 * In theory, some of these attributes should be required here
+	/* In theory, some of these attributes should be required here
 	 * but since they were not used when the command was originally
 	 * added, keep them optional for old user space programs to let
 	 * them continue to work with drivers that do not need the
@@ -3567,8 +3556,7 @@ static int parse_station_flags(struct genl_info *info,
 	struct nlattr *nla;
 	int flag;
 
-	/*
-	 * Try parsing the new attribute first so userspace
+	/* Try parsing the new attribute first so userspace
 	 * can specify both for older kernels.
 	 */
 	nla = info->attrs[NL80211_ATTR_STA_FLAGS2];
@@ -3595,8 +3583,7 @@ static int parse_station_flags(struct genl_info *info,
 			     nla, sta_flags_policy))
 		return -EINVAL;
 
-	/*
-	 * Only allow certain flags for interface types so that
+	/* Only allow certain flags for interface types so that
 	 * other attributes are silently ignored. Remember that
 	 * this is backward compatibility code with old userspace
 	 * and shouldn't be hit in other cases anyway.
@@ -4032,8 +4019,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 	switch (statype) {
 	case CFG80211_STA_MESH_PEER_KERNEL:
 	case CFG80211_STA_MESH_PEER_USER:
-		/*
-		 * No ignoring the TDLS flag here -- the userspace mesh
+		/* No ignoring the TDLS flag here -- the userspace mesh
 		 * code doesn't have the bug of including TDLS in the
 		 * mask everywhere.
 		 */
@@ -4065,8 +4051,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 		/* TDLS can't be set, ... */
 		if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
 			return -EINVAL;
-		/*
-		 * ... but don't bother the driver with it. This works around
+		/* ... but don't bother the driver with it. This works around
 		 * a hostapd/wpa_supplicant issue -- it always includes the
 		 * TLDS_PEER flag in the mask even for AP mode.
 		 */
@@ -4151,8 +4136,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_check_station_change);
 
-/*
- * Get vlan interface making sure it is running and on the right wiphy.
+/* Get vlan interface making sure it is running and on the right wiphy.
  */
 static struct net_device *get_vlan(struct genl_info *info,
 				   struct cfg80211_registered_device *rdev)
@@ -4239,8 +4223,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
 		     nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
 		params->supported_channels_len =
 		     nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
-		/*
-		 * Need to include at least one (first channel, number of
+		/* Need to include at least one (first channel, number of
 		 * channels) tuple for each subband, and must have proper
 		 * tuples for the rest of the data as well.
 		 */
@@ -4255,8 +4238,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
 		 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
 		params->supported_oper_classes_len =
 		  nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
-		/*
-		 * The value of the Length field of the Supported Operating
+		/* The value of the Length field of the Supported Operating
 		 * Classes element is between 2 and 253.
 		 */
 		if (params->supported_oper_classes_len < 2 ||
@@ -4300,8 +4282,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
 	if (!rdev->ops->change_station)
 		return -EOPNOTSUPP;
 
-	/*
-	 * AID and listen_interval properties can be set only for unassociated
+	/* AID and listen_interval properties can be set only for unassociated
 	 * station. Include these parameters here and will check them in
 	 * cfg80211_check_station_change().
 	 */
@@ -4458,8 +4439,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 
 		params.support_p2p_ps = tmp;
 	} else {
-		/*
-		 * if not specified, assume it's supported for P2P GO interface,
+		/* if not specified, assume it's supported for P2P GO interface,
 		 * and is NOT supported for AP interface
 		 */
 		params.support_p2p_ps =
@@ -4604,8 +4584,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 		/* ... with external setup is supported */
 		if (!(rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP))
 			return -EOPNOTSUPP;
-		/*
-		 * Older wpa_supplicant versions always mark the TDLS peer
+		/* Older wpa_supplicant versions always mark the TDLS peer
 		 * as authorized, but it shouldn't yet be.
 		 */
 		params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_AUTHORIZED);
@@ -5054,8 +5033,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 	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
 	 * window between nl80211_init() and regulatory_init(), if that is
 	 * even possible.
@@ -5271,7 +5249,8 @@ do {									    \
 		return -EINVAL;
 
 	/* This makes sure that there aren't more than 32 mesh config
-	 * parameters (otherwise our bitfield scheme would not work.) */
+	 * parameters (otherwise our bitfield scheme would not work.)
+	 */
 	BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
 
 	/* Fill in the params struct */
@@ -5770,8 +5749,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
 	rd->alpha2[0] = alpha2[0];
 	rd->alpha2[1] = alpha2[1];
 
-	/*
-	 * Disable DFS master mode if the DFS region was
+	/* Disable DFS master mode if the DFS region was
 	 * not supported or known on this kernel.
 	 */
 	if (reg_supported_dfs_region(dfs_region))
@@ -5813,8 +5791,7 @@ static int validate_scan_freqs(struct nlattr *freqs)
 
 	nla_for_each_nested(attr1, freqs, tmp1) {
 		n_channels++;
-		/*
-		 * Some hardware has a limited channel list for
+		/* Some hardware has a limited channel list for
 		 * scanning, and it is pretty much nonsensical
 		 * to scan for a channel twice, so disallow that
 		 * and don't require drivers to check that the
@@ -5924,8 +5901,7 @@ static int nl80211_parse_random_mac(struct nlattr **attrs,
 	    is_multicast_ether_addr(mac_addr))
 		return -EINVAL;
 
-	/*
-	 * allow users to pass a MAC address that has bits set outside
+	/* allow users to pass a MAC address that has bits set outside
 	 * of the mask, but don't bother drivers with having to deal
 	 * with such bits
 	 */
@@ -6192,8 +6168,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 	if (!attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
 		u32 interval;
 
-		/*
-		 * If scan plans are not specified,
+		/* If scan plans are not specified,
 		 * %NL80211_ATTR_SCHED_SCAN_INTERVAL must be specified. In this
 		 * case one scan plan will be set with the specified scan
 		 * interval and infinite number of iterations.
@@ -6248,8 +6223,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 			     wiphy->max_sched_scan_plan_iterations))
 				return -EINVAL;
 		} else if (i < n_plans - 1) {
-			/*
-			 * All scan plans but the last one must specify
+			/* All scan plans but the last one must specify
 			 * a finite number of iterations
 			 */
 			return -EINVAL;
@@ -6258,8 +6232,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 		i++;
 	}
 
-	/*
-	 * The last scan plan must not specify the number of
+	/* The last scan plan must not specify the number of
 	 * iterations, it is supposed to run infinitely
 	 */
 	if (request->scan_plans[n_plans - 1].iterations)
@@ -6300,8 +6273,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 	if (n_ssids > wiphy->max_sched_scan_ssids)
 		return ERR_PTR(-EINVAL);
 
-	/*
-	 * First, count the number of 'real' matchsets. Due to an issue with
+	/* First, count the number of 'real' matchsets. Due to an issue with
 	 * the old implementation, matchsets containing only the RSSI attribute
 	 * (NL80211_SCHED_SCAN_MATCH_ATTR_RSSI) are considered as the 'default'
 	 * RSSI for all matchsets, rather than their own matchset for reporting
@@ -6347,8 +6319,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 		return ERR_PTR(-EINVAL);
 
 	if (attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
-		/*
-		 * NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
+		/* NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
 		 * each scan plan already specifies its own interval
 		 */
 		if (attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL])
@@ -6358,8 +6329,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 				    attrs[NL80211_ATTR_SCHED_SCAN_PLANS], tmp)
 			n_plans++;
 	} else {
-		/*
-		 * The scan interval attribute is kept for backward
+		/* The scan interval attribute is kept for backward
 		 * compatibility. If no scan plans are specified and sched scan
 		 * interval is specified, one scan plan will be set with this
 		 * scan interval and infinite number of iterations.
@@ -7255,8 +7225,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
 
 	local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE];
 
-	/*
-	 * Since we no longer track auth state, ignore
+	/* Since we no longer track auth state, ignore
 	 * requests to only change local state.
 	 */
 	if (local_state_change)
@@ -7918,8 +7887,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
 	rtnl_lock();
 
 	if (cb->args[0]) {
-		/*
-		 * 0 is a valid index, but not valid for args[0],
+		/* 0 is a valid index, but not valid for args[0],
 		 * so we need to offset by 1.
 		 */
 		phy_idx = cb->args[0] - 1;
@@ -8364,8 +8332,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
 	    !(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL))
 		return -EOPNOTSUPP;
 
-	/*
-	 * We should be on that channel for at least a minimum amount of
+	/* We should be on that channel for at least a minimum amount of
 	 * time (10ms) but no longer than the driver supports.
 	 */
 	if (duration < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
@@ -8586,8 +8553,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 	if (!info->attrs[NL80211_ATTR_TX_RATES])
 		goto out;
 
-	/*
-	 * The nested attribute uses enum nl80211_band as the index. This maps
+	/* The nested attribute uses enum nl80211_band as the index. This maps
 	 * directly to the enum nl80211_band values used in cfg80211.
 	 */
 	BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
@@ -8736,8 +8702,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 		params.wait = nla_get_u32(info->attrs[NL80211_ATTR_DURATION]);
 
-		/*
-		 * We should wait on the channel for at least a minimum amount
+		/* We should wait on the channel for at least a minimum amount
 		 * of time (10ms) but no longer than the driver supports.
 		 */
 		if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
@@ -10758,8 +10723,7 @@ static int nl80211_tdls_channel_switch(struct sk_buff *skb,
 	if (err)
 		return err;
 
-	/*
-	 * Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
+	/* Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
 	 * section 10.22.6.2.1. Disallow 5/10Mhz channels as well for now, the
 	 * specification is not defined for them.
 	 */
@@ -11899,8 +11863,7 @@ nla_put_failure:
 	return false;
 }
 
-/*
- * This can happen on global regulatory changes or device specific settings
+/* This can happen on global regulatory changes or device specific settings
  * based on custom regulatory domains.
  */
 void nl80211_common_reg_change_event(enum nl80211_commands cmd_id,
@@ -12337,8 +12300,7 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
 		return;
 	}
 
-	/*
-	 * Since we are applying the beacon hint to a wiphy we know its
+	/* Since we are applying the beacon hint to a wiphy we know its
 	 * wiphy_idx is valid
 	 */
 	if (nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy)))
@@ -13453,8 +13415,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
 
 	rcu_read_unlock();
 
-	/*
-	 * It is possible that the user space process that is controlling the
+	/* It is possible that the user space process that is controlling the
 	 * indoor setting disappeared, so notify the regulatory core.
 	 */
 	regulatory_netlink_notify(notify->portid);
-- 
2.8.0.rc3.226.g39d4020


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 1/3] nl80211: Fix checkpatch warnings
@ 2016-05-29  3:30   ` Kirtika Ruchandani
  0 siblings, 0 replies; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-29  3:30 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	ruchandani.tina-Re5JQEeQqe8AvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA

This patch fixes the following checkpatch.pl warnings about
comments in nl80211.c :
- networking block comments don't use an empty '/*' line
- block comments use a trailing '*/' on a separate line

Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 net/wireless/nl80211.c | 129 +++++++++++++++++--------------------------------
 1 file changed, 45 insertions(+), 84 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d759901..50a0de0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -196,8 +196,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
 	return rdev;
 }
 
-/*
- * This function returns a pointer to the driver
+/* This function returns a pointer to the driver
  * that the genl_info item that is passed refers to.
  *
  * The result of this can be a PTR_ERR and hence must
@@ -1624,8 +1623,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 			goto nla_put_failure;
 
 		features = rdev->wiphy.features;
-		/*
-		 * We can only add the per-channel limit information if the
+		/* We can only add the per-channel limit information if the
 		 * dump is split, otherwise it makes it too big. Therefore
 		 * only advertise it in that case.
 		 */
@@ -1646,8 +1644,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 				rdev->wiphy.max_acl_mac_addrs))
 			goto nla_put_failure;
 
-		/*
-		 * Any information below this point is only available to
+		/* Any information below this point is only available to
 		 * applications that can deal with it being split. This
 		 * helps ensure that newly added capabilities don't break
 		 * older tools by overrunning their buffers.
@@ -1847,8 +1844,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
 						 cb->nlh->nlmsg_seq,
 						 NLM_F_MULTI, state);
 			if (ret < 0) {
-				/*
-				 * If sending the wiphy data didn't fit (ENOBUFS
+				/* If sending the wiphy data didn't fit (ENOBUFS
 				 * or EMSGSIZE returned), this SKB is still
 				 * empty (so it's not too big because another
 				 * wiphy dataset is already in the skb) and
@@ -1937,8 +1933,7 @@ static int parse_txq_params(struct nlattr *tb[],
 
 static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev)
 {
-	/*
-	 * You can only set the channel explicitly for WDS interfaces,
+	/* You can only set the channel explicitly for WDS interfaces,
 	 * all others have their channel managed via their respective
 	 * "establish a connection" command (connect, join, ...)
 	 *
@@ -2131,8 +2126,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 
 	ASSERT_RTNL();
 
-	/*
-	 * Try to find the wiphy and netdev. Normally this
+	/* Try to find the wiphy and netdev. Normally this
 	 * function shouldn't need the netdev, but this is
 	 * done for backward compatibility -- previously
 	 * setting the channel was done per wiphy, but now
@@ -2162,8 +2156,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 	} else
 		wdev = netdev->ieee80211_ptr;
 
-	/*
-	 * end workaround code, by now the rdev is available
+	/* end workaround code, by now the rdev is available
 	 * and locked, and wdev may or may not be NULL.
 	 */
 
@@ -2260,7 +2253,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]);
 
 		/* reject antenna configurations which don't match the
-		 * available antenna masks, except for the "all" mask */
+		 * available antenna masks, except for the "all" mask
+		 */
 		if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
 		    (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx)))
 			return -EINVAL;
@@ -2300,8 +2294,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 
 		if (frag_threshold != (u32) -1) {
-			/*
-			 * Fragments (apart from the last one) are required to
+			/* 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
 			 * odd threshold value.
@@ -2751,8 +2744,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 		wdev_unlock(wdev);
 		break;
 	case NL80211_IFTYPE_P2P_DEVICE:
-		/*
-		 * P2P Device doesn't have a netdev, so doesn't go
+		/* P2P Device doesn't have a netdev, so doesn't go
 		 * through the netdev notifier and must be added here
 		 */
 		mutex_init(&wdev->mtx);
@@ -2808,8 +2800,7 @@ static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
 		msg = NULL;
 	}
 
-	/*
-	 * If we remove a wireless device without a netdev then clear
+	/* If we remove a wireless device without a netdev then clear
 	 * user_ptr[1] so that nl80211_post_doit won't dereference it
 	 * to check if it needs to do dev_put(). Otherwise it crashes
 	 * since the wdev has been freed, unlike with a netdev where
@@ -3160,8 +3151,7 @@ static int validate_acl_mac_addrs(struct nlattr *nl_attr)
 	return n_entries;
 }
 
-/*
- * This function parses ACL information and allocates memory for ACL data.
+/* This function parses ACL information and allocates memory for ACL data.
  * On successful return, the calling function is responsible to free the
  * ACL buffer returned by this function.
  */
@@ -3377,8 +3367,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 	if (err)
 		return err;
 
-	/*
-	 * In theory, some of these attributes should be required here
+	/* In theory, some of these attributes should be required here
 	 * but since they were not used when the command was originally
 	 * added, keep them optional for old user space programs to let
 	 * them continue to work with drivers that do not need the
@@ -3567,8 +3556,7 @@ static int parse_station_flags(struct genl_info *info,
 	struct nlattr *nla;
 	int flag;
 
-	/*
-	 * Try parsing the new attribute first so userspace
+	/* Try parsing the new attribute first so userspace
 	 * can specify both for older kernels.
 	 */
 	nla = info->attrs[NL80211_ATTR_STA_FLAGS2];
@@ -3595,8 +3583,7 @@ static int parse_station_flags(struct genl_info *info,
 			     nla, sta_flags_policy))
 		return -EINVAL;
 
-	/*
-	 * Only allow certain flags for interface types so that
+	/* Only allow certain flags for interface types so that
 	 * other attributes are silently ignored. Remember that
 	 * this is backward compatibility code with old userspace
 	 * and shouldn't be hit in other cases anyway.
@@ -4032,8 +4019,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 	switch (statype) {
 	case CFG80211_STA_MESH_PEER_KERNEL:
 	case CFG80211_STA_MESH_PEER_USER:
-		/*
-		 * No ignoring the TDLS flag here -- the userspace mesh
+		/* No ignoring the TDLS flag here -- the userspace mesh
 		 * code doesn't have the bug of including TDLS in the
 		 * mask everywhere.
 		 */
@@ -4065,8 +4051,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 		/* TDLS can't be set, ... */
 		if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
 			return -EINVAL;
-		/*
-		 * ... but don't bother the driver with it. This works around
+		/* ... but don't bother the driver with it. This works around
 		 * a hostapd/wpa_supplicant issue -- it always includes the
 		 * TLDS_PEER flag in the mask even for AP mode.
 		 */
@@ -4151,8 +4136,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_check_station_change);
 
-/*
- * Get vlan interface making sure it is running and on the right wiphy.
+/* Get vlan interface making sure it is running and on the right wiphy.
  */
 static struct net_device *get_vlan(struct genl_info *info,
 				   struct cfg80211_registered_device *rdev)
@@ -4239,8 +4223,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
 		     nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
 		params->supported_channels_len =
 		     nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
-		/*
-		 * Need to include at least one (first channel, number of
+		/* Need to include at least one (first channel, number of
 		 * channels) tuple for each subband, and must have proper
 		 * tuples for the rest of the data as well.
 		 */
@@ -4255,8 +4238,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
 		 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
 		params->supported_oper_classes_len =
 		  nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
-		/*
-		 * The value of the Length field of the Supported Operating
+		/* The value of the Length field of the Supported Operating
 		 * Classes element is between 2 and 253.
 		 */
 		if (params->supported_oper_classes_len < 2 ||
@@ -4300,8 +4282,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
 	if (!rdev->ops->change_station)
 		return -EOPNOTSUPP;
 
-	/*
-	 * AID and listen_interval properties can be set only for unassociated
+	/* AID and listen_interval properties can be set only for unassociated
 	 * station. Include these parameters here and will check them in
 	 * cfg80211_check_station_change().
 	 */
@@ -4458,8 +4439,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 
 		params.support_p2p_ps = tmp;
 	} else {
-		/*
-		 * if not specified, assume it's supported for P2P GO interface,
+		/* if not specified, assume it's supported for P2P GO interface,
 		 * and is NOT supported for AP interface
 		 */
 		params.support_p2p_ps =
@@ -4604,8 +4584,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 		/* ... with external setup is supported */
 		if (!(rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP))
 			return -EOPNOTSUPP;
-		/*
-		 * Older wpa_supplicant versions always mark the TDLS peer
+		/* Older wpa_supplicant versions always mark the TDLS peer
 		 * as authorized, but it shouldn't yet be.
 		 */
 		params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_AUTHORIZED);
@@ -5054,8 +5033,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 	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
 	 * window between nl80211_init() and regulatory_init(), if that is
 	 * even possible.
@@ -5271,7 +5249,8 @@ do {									    \
 		return -EINVAL;
 
 	/* This makes sure that there aren't more than 32 mesh config
-	 * parameters (otherwise our bitfield scheme would not work.) */
+	 * parameters (otherwise our bitfield scheme would not work.)
+	 */
 	BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
 
 	/* Fill in the params struct */
@@ -5770,8 +5749,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
 	rd->alpha2[0] = alpha2[0];
 	rd->alpha2[1] = alpha2[1];
 
-	/*
-	 * Disable DFS master mode if the DFS region was
+	/* Disable DFS master mode if the DFS region was
 	 * not supported or known on this kernel.
 	 */
 	if (reg_supported_dfs_region(dfs_region))
@@ -5813,8 +5791,7 @@ static int validate_scan_freqs(struct nlattr *freqs)
 
 	nla_for_each_nested(attr1, freqs, tmp1) {
 		n_channels++;
-		/*
-		 * Some hardware has a limited channel list for
+		/* Some hardware has a limited channel list for
 		 * scanning, and it is pretty much nonsensical
 		 * to scan for a channel twice, so disallow that
 		 * and don't require drivers to check that the
@@ -5924,8 +5901,7 @@ static int nl80211_parse_random_mac(struct nlattr **attrs,
 	    is_multicast_ether_addr(mac_addr))
 		return -EINVAL;
 
-	/*
-	 * allow users to pass a MAC address that has bits set outside
+	/* allow users to pass a MAC address that has bits set outside
 	 * of the mask, but don't bother drivers with having to deal
 	 * with such bits
 	 */
@@ -6192,8 +6168,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 	if (!attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
 		u32 interval;
 
-		/*
-		 * If scan plans are not specified,
+		/* If scan plans are not specified,
 		 * %NL80211_ATTR_SCHED_SCAN_INTERVAL must be specified. In this
 		 * case one scan plan will be set with the specified scan
 		 * interval and infinite number of iterations.
@@ -6248,8 +6223,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 			     wiphy->max_sched_scan_plan_iterations))
 				return -EINVAL;
 		} else if (i < n_plans - 1) {
-			/*
-			 * All scan plans but the last one must specify
+			/* All scan plans but the last one must specify
 			 * a finite number of iterations
 			 */
 			return -EINVAL;
@@ -6258,8 +6232,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
 		i++;
 	}
 
-	/*
-	 * The last scan plan must not specify the number of
+	/* The last scan plan must not specify the number of
 	 * iterations, it is supposed to run infinitely
 	 */
 	if (request->scan_plans[n_plans - 1].iterations)
@@ -6300,8 +6273,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 	if (n_ssids > wiphy->max_sched_scan_ssids)
 		return ERR_PTR(-EINVAL);
 
-	/*
-	 * First, count the number of 'real' matchsets. Due to an issue with
+	/* First, count the number of 'real' matchsets. Due to an issue with
 	 * the old implementation, matchsets containing only the RSSI attribute
 	 * (NL80211_SCHED_SCAN_MATCH_ATTR_RSSI) are considered as the 'default'
 	 * RSSI for all matchsets, rather than their own matchset for reporting
@@ -6347,8 +6319,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 		return ERR_PTR(-EINVAL);
 
 	if (attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
-		/*
-		 * NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
+		/* NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
 		 * each scan plan already specifies its own interval
 		 */
 		if (attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL])
@@ -6358,8 +6329,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 				    attrs[NL80211_ATTR_SCHED_SCAN_PLANS], tmp)
 			n_plans++;
 	} else {
-		/*
-		 * The scan interval attribute is kept for backward
+		/* The scan interval attribute is kept for backward
 		 * compatibility. If no scan plans are specified and sched scan
 		 * interval is specified, one scan plan will be set with this
 		 * scan interval and infinite number of iterations.
@@ -7255,8 +7225,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
 
 	local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE];
 
-	/*
-	 * Since we no longer track auth state, ignore
+	/* Since we no longer track auth state, ignore
 	 * requests to only change local state.
 	 */
 	if (local_state_change)
@@ -7918,8 +7887,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
 	rtnl_lock();
 
 	if (cb->args[0]) {
-		/*
-		 * 0 is a valid index, but not valid for args[0],
+		/* 0 is a valid index, but not valid for args[0],
 		 * so we need to offset by 1.
 		 */
 		phy_idx = cb->args[0] - 1;
@@ -8364,8 +8332,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
 	    !(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL))
 		return -EOPNOTSUPP;
 
-	/*
-	 * We should be on that channel for at least a minimum amount of
+	/* We should be on that channel for at least a minimum amount of
 	 * time (10ms) but no longer than the driver supports.
 	 */
 	if (duration < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
@@ -8586,8 +8553,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 	if (!info->attrs[NL80211_ATTR_TX_RATES])
 		goto out;
 
-	/*
-	 * The nested attribute uses enum nl80211_band as the index. This maps
+	/* The nested attribute uses enum nl80211_band as the index. This maps
 	 * directly to the enum nl80211_band values used in cfg80211.
 	 */
 	BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
@@ -8736,8 +8702,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 		params.wait = nla_get_u32(info->attrs[NL80211_ATTR_DURATION]);
 
-		/*
-		 * We should wait on the channel for at least a minimum amount
+		/* We should wait on the channel for at least a minimum amount
 		 * of time (10ms) but no longer than the driver supports.
 		 */
 		if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
@@ -10758,8 +10723,7 @@ static int nl80211_tdls_channel_switch(struct sk_buff *skb,
 	if (err)
 		return err;
 
-	/*
-	 * Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
+	/* Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
 	 * section 10.22.6.2.1. Disallow 5/10Mhz channels as well for now, the
 	 * specification is not defined for them.
 	 */
@@ -11899,8 +11863,7 @@ nla_put_failure:
 	return false;
 }
 
-/*
- * This can happen on global regulatory changes or device specific settings
+/* This can happen on global regulatory changes or device specific settings
  * based on custom regulatory domains.
  */
 void nl80211_common_reg_change_event(enum nl80211_commands cmd_id,
@@ -12337,8 +12300,7 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
 		return;
 	}
 
-	/*
-	 * Since we are applying the beacon hint to a wiphy we know its
+	/* Since we are applying the beacon hint to a wiphy we know its
 	 * wiphy_idx is valid
 	 */
 	if (nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy)))
@@ -13453,8 +13415,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
 
 	rcu_read_unlock();
 
-	/*
-	 * It is possible that the user space process that is controlling the
+	/* It is possible that the user space process that is controlling the
 	 * indoor setting disappeared, so notify the regulatory core.
 	 */
 	regulatory_netlink_notify(notify->portid);
-- 
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] nl80211: Fix checkpatch warnings about blank lines
  2016-05-29  3:30 [PATCH 0/3] nl80211: Fix checkpatch.pl issues Kirtika Ruchandani
  2016-05-29  3:30   ` Kirtika Ruchandani
@ 2016-05-29  3:31 ` Kirtika Ruchandani
  2016-05-30  0:31     ` Julian Calaby
  2016-05-29  3:31 ` [PATCH 3/3] nl80211: Various checkpatch.pl fixes Kirtika Ruchandani
  2 siblings, 1 reply; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-29  3:31 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ruchandani.tina, netdev

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

Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>
---
 net/wireless/nl80211.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 50a0de0..cd422bd 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -167,6 +167,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
 
 	if (attrs[NL80211_ATTR_IFINDEX]) {
 		int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]);
+
 		netdev = __dev_get_by_index(netns, ifindex);
 		if (netdev) {
 			if (netdev->ieee80211_ptr)
@@ -730,6 +731,7 @@ static int nl80211_parse_key_new(struct nlattr *key, struct key_parse *k)
 
 	if (tb[NL80211_KEY_DEFAULT_TYPES]) {
 		struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES];
+
 		err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1,
 				       tb[NL80211_KEY_DEFAULT_TYPES],
 				       nl80211_key_default_policy);
@@ -1381,6 +1383,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 		    rdev->ops->get_antenna) {
 			u32 tx_ant = 0, rx_ant = 0;
 			int res;
+
 			res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
 			if (!res) {
 				if (nla_put_u32(msg,
@@ -2111,7 +2114,6 @@ static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info)
 	return rdev_set_wds_peer(rdev, dev, bssid);
 }
 
-
 static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev;
@@ -2244,6 +2246,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 	if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
 	    info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
 		u32 tx_ant, rx_ant;
+
 		if ((!rdev->wiphy.available_antennas_tx &&
 		     !rdev->wiphy.available_antennas_rx) ||
 		    !rdev->ops->set_antenna)
@@ -2910,6 +2913,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
 	pairwise = !!mac_addr;
 	if (info->attrs[NL80211_ATTR_KEY_TYPE]) {
 		u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
+
 		if (kt >= NUM_NL80211_KEYTYPES)
 			return -EINVAL;
 		if (kt != NL80211_KEYTYPE_GROUP &&
@@ -3949,7 +3953,6 @@ static int nl80211_dump_station(struct sk_buff *skb,
 		sta_idx++;
 	}
 
-
  out:
 	cb->args[2] = sta_idx;
 	err = skb->len;
@@ -4742,7 +4745,6 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
 		path_idx++;
 	}
 
-
  out:
 	cb->args[2] = path_idx;
 	err = skb->len;
@@ -5032,7 +5034,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;
 	u32 owner_nlportid;
 
-
 	/* You should only get this when cfg80211 hasn't yet initialized
 	 * completely when built-in to the kernel right between the time
 	 * window between nl80211_init() and regulatory_init(), if that is
@@ -5240,7 +5241,6 @@ do {									    \
 	}								    \
 } while (0)
 
-
 	if (!info->attrs[NL80211_ATTR_MESH_CONFIG])
 		return -EINVAL;
 	if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX,
@@ -5388,7 +5388,6 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
 		 IEEE80211_PATH_METRIC_VENDOR :
 		 IEEE80211_PATH_METRIC_AIRTIME;
 
-
 	if (tb[NL80211_MESH_SETUP_IE]) {
 		struct nlattr *ieattr =
 			tb[NL80211_MESH_SETUP_IE];
@@ -6009,6 +6008,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
 		/* all channels */
 		for (band = 0; band < NUM_NL80211_BANDS; band++) {
 			int j;
+
 			if (!wiphy->bands[band])
 				continue;
 			for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
@@ -6412,6 +6412,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 		/* all channels */
 		for (band = 0; band < NUM_NL80211_BANDS; band++) {
 			int j;
+
 			if (!wiphy->bands[band])
 				continue;
 			for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
@@ -7174,6 +7175,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
 	if (key.idx >= 0) {
 		int i;
 		bool ok = false;
+
 		for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
 			if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
 				ok = true;
@@ -7251,6 +7253,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
 
 	if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) {
 		u16 proto;
+
 		proto = nla_get_u16(
 			info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]);
 		settings->control_port_ethertype = cpu_to_be16(proto);
@@ -8402,6 +8405,7 @@ static u32 rateset_to_mask(struct ieee80211_supported_band *sband,
 	for (i = 0; i < rates_len; i++) {
 		int rate = (rates[i] & 0x7f) * 5;
 		int ridx;
+
 		for (ridx = 0; ridx < sband->n_bitrates; ridx++) {
 			struct ieee80211_rate *srate =
 				&sband->bitrates[ridx];
@@ -8708,7 +8712,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 		if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
 		    params.wait > rdev->wiphy.max_remain_on_channel_duration)
 			return -EINVAL;
-
 	}
 
 	params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
@@ -10555,7 +10558,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
 }
 EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
 
-
 static int nl80211_set_qos_map(struct sk_buff *skb,
 			       struct genl_info *info)
 {
@@ -12089,7 +12091,6 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
  nla_put_failure:
 	genlmsg_cancel(msg, hdr);
 	nlmsg_free(msg);
-
 }
 
 void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
@@ -12128,7 +12129,6 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
  nla_put_failure:
 	genlmsg_cancel(msg, hdr);
 	nlmsg_free(msg);
-
 }
 
 void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
@@ -12166,7 +12166,6 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
  nla_put_failure:
 	genlmsg_cancel(msg, hdr);
 	nlmsg_free(msg);
-
 }
 
 void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
@@ -13506,7 +13505,6 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
 	if (hdr)
 		genlmsg_cancel(msg, hdr);
 	nlmsg_free(msg);
-
 }
 EXPORT_SYMBOL(cfg80211_crit_proto_stopped);
 
-- 
2.8.0.rc3.226.g39d4020


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] nl80211:  Various checkpatch.pl fixes
  2016-05-29  3:30 [PATCH 0/3] nl80211: Fix checkpatch.pl issues Kirtika Ruchandani
  2016-05-29  3:30   ` Kirtika Ruchandani
  2016-05-29  3:31 ` [PATCH 2/3] nl80211: Fix checkpatch warnings about blank lines Kirtika Ruchandani
@ 2016-05-29  3:31 ` Kirtika Ruchandani
  2016-05-30  0:35   ` Julian Calaby
  2 siblings, 1 reply; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-29  3:31 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ruchandani.tina, netdev

This patch fixes the following checkpatch.pl issues -
- space preferred around that <operator>
- no space needed after cast.
- braces {} should be used on all arms of this statement
- Alignment should match open parenthesis
- suspect code indent for conditional statements
- Statements should start on a tabstop
- multiple assignments should be avoided
- prefer ether_addr_copy over memcpy
- correct spelling - 'implementation'
- comparison to NULL could be written as !foo
- prefer kcalloc over kzalloc with multiply

Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>
---
 net/wireless/nl80211.c | 152 ++++++++++++++++++++++++++-----------------------
 1 file changed, 82 insertions(+), 70 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cd422bd..9f7eb16 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 },
@@ -870,8 +870,9 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev,
 			result->def = parse.idx;
 			if (!parse.def_uni || !parse.def_multi)
 				goto error;
-		} else if (parse.defmgmt)
+		} else if (parse.defmgmt) {
 			goto error;
+		}
 		err = cfg80211_validate_key_settings(rdev, &parse.p,
 						     parse.idx, false, NULL);
 		if (err)
@@ -927,7 +928,7 @@ static struct ieee80211_channel *nl80211_get_valid_chan(struct wiphy *wiphy,
 {
 	struct ieee80211_channel *chan;
 
-	if (tb == NULL)
+	if (!tb)
 		return NULL;
 	chan = ieee80211_get_channel(wiphy, nla_get_u32(tb));
 	if (!chan || chan->flags & IEEE80211_CHAN_DISABLED)
@@ -966,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;
 
@@ -1011,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);
@@ -1401,8 +1402,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 			break;
 	case 2:
 		if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES,
-					rdev->wiphy.interface_modes))
-				goto nla_put_failure;
+					rdev->wiphy.interface_modes)) {
+			goto nla_put_failure;
+		}
 		state->split_start++;
 		if (state->split)
 			break;
@@ -1491,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)) \
@@ -1733,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,
@@ -2155,8 +2158,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		wdev = NULL;
 		netdev = NULL;
 		result = 0;
-	} else
+	} else {
 		wdev = netdev->ieee80211_ptr;
+	}
 
 	/* end workaround code, by now the rdev is available
 	 * and locked, and wdev may or may not be NULL.
@@ -2296,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
@@ -2403,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)
 {
@@ -2467,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;
@@ -2554,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<<flag);
+			*mntrflags |= (1 << flag);
 
 	return 0;
 }
@@ -2597,7 +2603,8 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
 
 	memset(&params, 0, sizeof(params));
 
-	otype = ntype = dev->ieee80211_ptr->iftype;
+	otype = dev->ieee80211_ptr->iftype;
+	ntype = dev->ieee80211_ptr->iftype;
 
 	if (info->attrs[NL80211_ATTR_IFTYPE]) {
 		ntype = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
@@ -2719,9 +2726,9 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 		return -ENOMEM;
 
 	wdev = rdev_add_virtual_intf(rdev,
-				nla_data(info->attrs[NL80211_ATTR_IFNAME]),
-				NET_NAME_USER, type, err ? NULL : &flags,
-				&params);
+				     nla_data(info->attrs[NL80211_ATTR_IFNAME]),
+				     NET_NAME_USER, type, err ? NULL : &flags,
+				     &params);
 	if (WARN_ON(!wdev)) {
 		nlmsg_free(msg);
 		return -EPROTO;
@@ -2997,7 +3004,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;
@@ -3194,7 +3201,7 @@ static struct cfg80211_acl_data *parse_acl_data(struct wiphy *wiphy,
 		return ERR_PTR(-ENOMEM);
 
 	nla_for_each_nested(attr, info->attrs[NL80211_ATTR_MAC_ADDRS], tmp) {
-		memcpy(acl->mac_addrs[i].addr, nla_data(attr), ETH_ALEN);
+		ether_addr_copy(acl->mac_addrs[i].addr, nla_data(attr));
 		i++;
 	}
 
@@ -3403,8 +3410,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 		if (!nl80211_valid_auth_type(rdev, params.auth_type,
 					     NL80211_CMD_START_AP))
 			return -EINVAL;
-	} else
+	} else {
 		params.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
+	}
 
 	err = nl80211_crypto_settings(rdev, info, &params.crypto,
 				      NL80211_MAX_NR_CIPHER_SUITES);
@@ -3450,8 +3458,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 			return err;
 	} else if (wdev->preset_chandef.chan) {
 		params.chandef = wdev->preset_chandef;
-	} else if (!nl80211_get_ap_channel(rdev, &params))
+	} else if (!nl80211_get_ap_channel(rdev, &params)) {
 		return -EINVAL;
+	}
 
 	if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params.chandef,
 					   wdev->iftype))
@@ -3616,7 +3625,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<<flag);
+			params->sta_flags_set |= (1 << flag);
 
 			/* no longer support new API additions in old API */
 			if (flag > NL80211_STA_FLAG_MAX_OLD_API)
@@ -3944,10 +3953,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++;
@@ -4219,7 +4228,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 =
@@ -4650,9 +4659,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;
@@ -4785,7 +4794,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;
 	}
@@ -5180,7 +5189,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 },
@@ -5212,7 +5222,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 },
@@ -5358,7 +5368,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];
@@ -5667,7 +5677,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 = &reg_rule->freq_range;
 	struct ieee80211_power_rule *power_rule = &reg_rule->power_rule;
@@ -5892,8 +5902,8 @@ static int nl80211_parse_random_mac(struct nlattr **attrs,
 	if (!attrs[NL80211_ATTR_MAC] || !attrs[NL80211_ATTR_MAC_MASK])
 		return -EINVAL;
 
-	memcpy(mac_addr, nla_data(attrs[NL80211_ATTR_MAC]), ETH_ALEN);
-	memcpy(mac_addr_mask, nla_data(attrs[NL80211_ATTR_MAC_MASK]), ETH_ALEN);
+	ether_addr_copy(mac_addr, nla_data(attrs[NL80211_ATTR_MAC]));
+	ether_addr_copy(mac_addr_mask, nla_data(attrs[NL80211_ATTR_MAC_MASK]));
 
 	/* don't allow or configure an mcast address */
 	if (!is_multicast_ether_addr(mac_addr_mask) ||
@@ -6482,7 +6492,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
 				       nla_data(ssid), nla_len(ssid));
 				request->match_sets[i].ssid.ssid_len =
 					nla_len(ssid);
-				/* special attribute - old implemenation w/a */
+				/* special attribute - old implementation w/a */
 				request->match_sets[i].rssi_thold =
 					default_match_rssi;
 				rssi = tb[NL80211_SCHED_SCAN_MATCH_ATTR_RSSI];
@@ -6681,7 +6691,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;
@@ -6977,8 +6987,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;
 		}
@@ -7030,7 +7040,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,
@@ -7104,9 +7114,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++;
 	}
@@ -7262,8 +7272,9 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
 			return -EINVAL;
 		if (info->attrs[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT])
 			settings->control_port_no_encrypt = true;
-	} else
+	} else {
 		settings->control_port_ethertype = cpu_to_be16(ETH_P_PAE);
+	}
 
 	if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) {
 		void *data;
@@ -7668,8 +7679,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);
 
@@ -7997,8 +8008,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
 		if (!nl80211_valid_auth_type(rdev, connect.auth_type,
 					     NL80211_CMD_CONNECT))
 			return -EINVAL;
-	} else
+	} else {
 		connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
+	}
 
 	connect.privacy = info->attrs[NL80211_ATTR_PRIVACY];
 
@@ -8015,7 +8027,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]);
 	}
@@ -8060,7 +8072,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);
 	}
@@ -8560,7 +8573,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 	/* The nested attribute uses enum nl80211_band as the index. This maps
 	 * directly to the enum nl80211_band values used in cfg80211.
 	 */
-	BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
+	BUILD_BUG_ON(IEEE80211_HT_MCS_MASK_LEN * 8 < NL80211_MAX_SUPP_HT_RATES);
 	nla_for_each_nested(tx_rates, info->attrs[NL80211_ATTR_TX_RATES], rem) {
 		enum nl80211_band band = nla_type(tx_rates);
 		int err;
@@ -8568,7 +8581,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 		if (band < 0 || band >= NUM_NL80211_BANDS)
 			return -EINVAL;
 		sband = rdev->wiphy.bands[band];
-		if (sband == NULL)
+		if (!sband)
 			return -EINVAL;
 		err = nla_parse(tb, NL80211_TXRATE_MAX, nla_data(tx_rates),
 				nla_len(tx_rates), nl80211_txattr_policy);
@@ -9039,7 +9052,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 =
@@ -9405,8 +9418,7 @@ static int nl80211_parse_wowlan_tcp(struct cfg80211_registered_device *rdev,
 		return -ENOMEM;
 	cfg->src = nla_get_in_addr(tb[NL80211_WOWLAN_TCP_SRC_IPV4]);
 	cfg->dst = nla_get_in_addr(tb[NL80211_WOWLAN_TCP_DST_IPV4]);
-	memcpy(cfg->dst_mac, nla_data(tb[NL80211_WOWLAN_TCP_DST_MAC]),
-	       ETH_ALEN);
+	ether_addr_copy(cfg->dst_mac, nla_data(tb[NL80211_WOWLAN_TCP_DST_MAC]));
 	if (tb[NL80211_WOWLAN_TCP_SRC_PORT])
 		port = nla_get_u16(tb[NL80211_WOWLAN_TCP_SRC_PORT]);
 	else
@@ -9470,7 +9482,7 @@ static int nl80211_parse_wowlan_nd(struct cfg80211_registered_device *rdev,
 	struct nlattr **tb;
 	int err;
 
-	tb = kzalloc(NUM_NL80211_ATTR * sizeof(*tb), GFP_KERNEL);
+	tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL);
 	if (!tb)
 		return -ENOMEM;
 
@@ -12202,7 +12214,7 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
 }
 
 void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr,
-					const u8* ie, u8 ie_len, gfp_t gfp)
+					const u8 *ie, u8 ie_len, gfp_t gfp)
 {
 	struct wireless_dev *wdev = dev->ieee80211_ptr;
 	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
@@ -12228,7 +12240,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);
@@ -12952,7 +12964,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);
 
@@ -13291,7 +13303,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);
 	}
@@ -13350,7 +13362,7 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
 }
 EXPORT_SYMBOL(cfg80211_tdls_oper_request);
 
-static int nl80211_netlink_notify(struct notifier_block * nb,
+static int nl80211_netlink_notify(struct notifier_block *nb,
 				  unsigned long state,
 				  void *_notify)
 {
-- 
2.8.0.rc3.226.g39d4020


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] nl80211: Fix checkpatch warnings
  2016-05-29  3:30   ` Kirtika Ruchandani
  (?)
@ 2016-05-30  0:30   ` Julian Calaby
  2016-05-31 10:29     ` Johannes Berg
  -1 siblings, 1 reply; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Kirtika Ruchandani, ruchandani.tina, netdev

Hi All,

On Sun, May 29, 2016 at 1:30 PM, Kirtika Ruchandani
<kirtika.ruchandani@gmail.com> wrote:
> This patch fixes the following checkpatch.pl warnings about
> comments in nl80211.c :
> - networking block comments don't use an empty '/*' line
> - block comments use a trailing '*/' on a separate line
>
> Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>

The change and logic behind it are sound, so it gets my:

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

however I'm concerned that this file is a deliberate exception to the
networking comment rules.

Johannes?

Thanks,

Julian Calaby


> ---
>  net/wireless/nl80211.c | 129 +++++++++++++++++--------------------------------
>  1 file changed, 45 insertions(+), 84 deletions(-)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index d759901..50a0de0 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -196,8 +196,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
>         return rdev;
>  }
>
> -/*
> - * This function returns a pointer to the driver
> +/* This function returns a pointer to the driver
>   * that the genl_info item that is passed refers to.
>   *
>   * The result of this can be a PTR_ERR and hence must
> @@ -1624,8 +1623,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
>                         goto nla_put_failure;
>
>                 features = rdev->wiphy.features;
> -               /*
> -                * We can only add the per-channel limit information if the
> +               /* We can only add the per-channel limit information if the
>                  * dump is split, otherwise it makes it too big. Therefore
>                  * only advertise it in that case.
>                  */
> @@ -1646,8 +1644,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
>                                 rdev->wiphy.max_acl_mac_addrs))
>                         goto nla_put_failure;
>
> -               /*
> -                * Any information below this point is only available to
> +               /* Any information below this point is only available to
>                  * applications that can deal with it being split. This
>                  * helps ensure that newly added capabilities don't break
>                  * older tools by overrunning their buffers.
> @@ -1847,8 +1844,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
>                                                  cb->nlh->nlmsg_seq,
>                                                  NLM_F_MULTI, state);
>                         if (ret < 0) {
> -                               /*
> -                                * If sending the wiphy data didn't fit (ENOBUFS
> +                               /* If sending the wiphy data didn't fit (ENOBUFS
>                                  * or EMSGSIZE returned), this SKB is still
>                                  * empty (so it's not too big because another
>                                  * wiphy dataset is already in the skb) and
> @@ -1937,8 +1933,7 @@ static int parse_txq_params(struct nlattr *tb[],
>
>  static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev)
>  {
> -       /*
> -        * You can only set the channel explicitly for WDS interfaces,
> +       /* You can only set the channel explicitly for WDS interfaces,
>          * all others have their channel managed via their respective
>          * "establish a connection" command (connect, join, ...)
>          *
> @@ -2131,8 +2126,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>
>         ASSERT_RTNL();
>
> -       /*
> -        * Try to find the wiphy and netdev. Normally this
> +       /* Try to find the wiphy and netdev. Normally this
>          * function shouldn't need the netdev, but this is
>          * done for backward compatibility -- previously
>          * setting the channel was done per wiphy, but now
> @@ -2162,8 +2156,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>         } else
>                 wdev = netdev->ieee80211_ptr;
>
> -       /*
> -        * end workaround code, by now the rdev is available
> +       /* end workaround code, by now the rdev is available
>          * and locked, and wdev may or may not be NULL.
>          */
>
> @@ -2260,7 +2253,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>                 rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]);
>
>                 /* reject antenna configurations which don't match the
> -                * available antenna masks, except for the "all" mask */
> +                * available antenna masks, except for the "all" mask
> +                */
>                 if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
>                     (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx)))
>                         return -EINVAL;
> @@ -2300,8 +2294,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>                         return -EINVAL;
>
>                 if (frag_threshold != (u32) -1) {
> -                       /*
> -                        * Fragments (apart from the last one) are required to
> +                       /* 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
>                          * odd threshold value.
> @@ -2751,8 +2744,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
>                 wdev_unlock(wdev);
>                 break;
>         case NL80211_IFTYPE_P2P_DEVICE:
> -               /*
> -                * P2P Device doesn't have a netdev, so doesn't go
> +               /* P2P Device doesn't have a netdev, so doesn't go
>                  * through the netdev notifier and must be added here
>                  */
>                 mutex_init(&wdev->mtx);
> @@ -2808,8 +2800,7 @@ static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
>                 msg = NULL;
>         }
>
> -       /*
> -        * If we remove a wireless device without a netdev then clear
> +       /* If we remove a wireless device without a netdev then clear
>          * user_ptr[1] so that nl80211_post_doit won't dereference it
>          * to check if it needs to do dev_put(). Otherwise it crashes
>          * since the wdev has been freed, unlike with a netdev where
> @@ -3160,8 +3151,7 @@ static int validate_acl_mac_addrs(struct nlattr *nl_attr)
>         return n_entries;
>  }
>
> -/*
> - * This function parses ACL information and allocates memory for ACL data.
> +/* This function parses ACL information and allocates memory for ACL data.
>   * On successful return, the calling function is responsible to free the
>   * ACL buffer returned by this function.
>   */
> @@ -3377,8 +3367,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
>         if (err)
>                 return err;
>
> -       /*
> -        * In theory, some of these attributes should be required here
> +       /* In theory, some of these attributes should be required here
>          * but since they were not used when the command was originally
>          * added, keep them optional for old user space programs to let
>          * them continue to work with drivers that do not need the
> @@ -3567,8 +3556,7 @@ static int parse_station_flags(struct genl_info *info,
>         struct nlattr *nla;
>         int flag;
>
> -       /*
> -        * Try parsing the new attribute first so userspace
> +       /* Try parsing the new attribute first so userspace
>          * can specify both for older kernels.
>          */
>         nla = info->attrs[NL80211_ATTR_STA_FLAGS2];
> @@ -3595,8 +3583,7 @@ static int parse_station_flags(struct genl_info *info,
>                              nla, sta_flags_policy))
>                 return -EINVAL;
>
> -       /*
> -        * Only allow certain flags for interface types so that
> +       /* Only allow certain flags for interface types so that
>          * other attributes are silently ignored. Remember that
>          * this is backward compatibility code with old userspace
>          * and shouldn't be hit in other cases anyway.
> @@ -4032,8 +4019,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
>         switch (statype) {
>         case CFG80211_STA_MESH_PEER_KERNEL:
>         case CFG80211_STA_MESH_PEER_USER:
> -               /*
> -                * No ignoring the TDLS flag here -- the userspace mesh
> +               /* No ignoring the TDLS flag here -- the userspace mesh
>                  * code doesn't have the bug of including TDLS in the
>                  * mask everywhere.
>                  */
> @@ -4065,8 +4051,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
>                 /* TDLS can't be set, ... */
>                 if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
>                         return -EINVAL;
> -               /*
> -                * ... but don't bother the driver with it. This works around
> +               /* ... but don't bother the driver with it. This works around
>                  * a hostapd/wpa_supplicant issue -- it always includes the
>                  * TLDS_PEER flag in the mask even for AP mode.
>                  */
> @@ -4151,8 +4136,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
>  }
>  EXPORT_SYMBOL(cfg80211_check_station_change);
>
> -/*
> - * Get vlan interface making sure it is running and on the right wiphy.
> +/* Get vlan interface making sure it is running and on the right wiphy.
>   */
>  static struct net_device *get_vlan(struct genl_info *info,
>                                    struct cfg80211_registered_device *rdev)
> @@ -4239,8 +4223,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
>                      nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
>                 params->supported_channels_len =
>                      nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
> -               /*
> -                * Need to include at least one (first channel, number of
> +               /* Need to include at least one (first channel, number of
>                  * channels) tuple for each subband, and must have proper
>                  * tuples for the rest of the data as well.
>                  */
> @@ -4255,8 +4238,7 @@ static int nl80211_parse_sta_channel_info(struct genl_info *info,
>                  nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
>                 params->supported_oper_classes_len =
>                   nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
> -               /*
> -                * The value of the Length field of the Supported Operating
> +               /* The value of the Length field of the Supported Operating
>                  * Classes element is between 2 and 253.
>                  */
>                 if (params->supported_oper_classes_len < 2 ||
> @@ -4300,8 +4282,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
>         if (!rdev->ops->change_station)
>                 return -EOPNOTSUPP;
>
> -       /*
> -        * AID and listen_interval properties can be set only for unassociated
> +       /* AID and listen_interval properties can be set only for unassociated
>          * station. Include these parameters here and will check them in
>          * cfg80211_check_station_change().
>          */
> @@ -4458,8 +4439,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
>
>                 params.support_p2p_ps = tmp;
>         } else {
> -               /*
> -                * if not specified, assume it's supported for P2P GO interface,
> +               /* if not specified, assume it's supported for P2P GO interface,
>                  * and is NOT supported for AP interface
>                  */
>                 params.support_p2p_ps =
> @@ -4604,8 +4584,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
>                 /* ... with external setup is supported */
>                 if (!(rdev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP))
>                         return -EOPNOTSUPP;
> -               /*
> -                * Older wpa_supplicant versions always mark the TDLS peer
> +               /* Older wpa_supplicant versions always mark the TDLS peer
>                  * as authorized, but it shouldn't yet be.
>                  */
>                 params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_AUTHORIZED);
> @@ -5054,8 +5033,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
>         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
>          * window between nl80211_init() and regulatory_init(), if that is
>          * even possible.
> @@ -5271,7 +5249,8 @@ do {                                                                          \
>                 return -EINVAL;
>
>         /* This makes sure that there aren't more than 32 mesh config
> -        * parameters (otherwise our bitfield scheme would not work.) */
> +        * parameters (otherwise our bitfield scheme would not work.)
> +        */
>         BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
>
>         /* Fill in the params struct */
> @@ -5770,8 +5749,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
>         rd->alpha2[0] = alpha2[0];
>         rd->alpha2[1] = alpha2[1];
>
> -       /*
> -        * Disable DFS master mode if the DFS region was
> +       /* Disable DFS master mode if the DFS region was
>          * not supported or known on this kernel.
>          */
>         if (reg_supported_dfs_region(dfs_region))
> @@ -5813,8 +5791,7 @@ static int validate_scan_freqs(struct nlattr *freqs)
>
>         nla_for_each_nested(attr1, freqs, tmp1) {
>                 n_channels++;
> -               /*
> -                * Some hardware has a limited channel list for
> +               /* Some hardware has a limited channel list for
>                  * scanning, and it is pretty much nonsensical
>                  * to scan for a channel twice, so disallow that
>                  * and don't require drivers to check that the
> @@ -5924,8 +5901,7 @@ static int nl80211_parse_random_mac(struct nlattr **attrs,
>             is_multicast_ether_addr(mac_addr))
>                 return -EINVAL;
>
> -       /*
> -        * allow users to pass a MAC address that has bits set outside
> +       /* allow users to pass a MAC address that has bits set outside
>          * of the mask, but don't bother drivers with having to deal
>          * with such bits
>          */
> @@ -6192,8 +6168,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
>         if (!attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
>                 u32 interval;
>
> -               /*
> -                * If scan plans are not specified,
> +               /* If scan plans are not specified,
>                  * %NL80211_ATTR_SCHED_SCAN_INTERVAL must be specified. In this
>                  * case one scan plan will be set with the specified scan
>                  * interval and infinite number of iterations.
> @@ -6248,8 +6223,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
>                              wiphy->max_sched_scan_plan_iterations))
>                                 return -EINVAL;
>                 } else if (i < n_plans - 1) {
> -                       /*
> -                        * All scan plans but the last one must specify
> +                       /* All scan plans but the last one must specify
>                          * a finite number of iterations
>                          */
>                         return -EINVAL;
> @@ -6258,8 +6232,7 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
>                 i++;
>         }
>
> -       /*
> -        * The last scan plan must not specify the number of
> +       /* The last scan plan must not specify the number of
>          * iterations, it is supposed to run infinitely
>          */
>         if (request->scan_plans[n_plans - 1].iterations)
> @@ -6300,8 +6273,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
>         if (n_ssids > wiphy->max_sched_scan_ssids)
>                 return ERR_PTR(-EINVAL);
>
> -       /*
> -        * First, count the number of 'real' matchsets. Due to an issue with
> +       /* First, count the number of 'real' matchsets. Due to an issue with
>          * the old implementation, matchsets containing only the RSSI attribute
>          * (NL80211_SCHED_SCAN_MATCH_ATTR_RSSI) are considered as the 'default'
>          * RSSI for all matchsets, rather than their own matchset for reporting
> @@ -6347,8 +6319,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
>                 return ERR_PTR(-EINVAL);
>
>         if (attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) {
> -               /*
> -                * NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
> +               /* NL80211_ATTR_SCHED_SCAN_INTERVAL must not be specified since
>                  * each scan plan already specifies its own interval
>                  */
>                 if (attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL])
> @@ -6358,8 +6329,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
>                                     attrs[NL80211_ATTR_SCHED_SCAN_PLANS], tmp)
>                         n_plans++;
>         } else {
> -               /*
> -                * The scan interval attribute is kept for backward
> +               /* The scan interval attribute is kept for backward
>                  * compatibility. If no scan plans are specified and sched scan
>                  * interval is specified, one scan plan will be set with this
>                  * scan interval and infinite number of iterations.
> @@ -7255,8 +7225,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
>
>         local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE];
>
> -       /*
> -        * Since we no longer track auth state, ignore
> +       /* Since we no longer track auth state, ignore
>          * requests to only change local state.
>          */
>         if (local_state_change)
> @@ -7918,8 +7887,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
>         rtnl_lock();
>
>         if (cb->args[0]) {
> -               /*
> -                * 0 is a valid index, but not valid for args[0],
> +               /* 0 is a valid index, but not valid for args[0],
>                  * so we need to offset by 1.
>                  */
>                 phy_idx = cb->args[0] - 1;
> @@ -8364,8 +8332,7 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
>             !(rdev->wiphy.flags & WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL))
>                 return -EOPNOTSUPP;
>
> -       /*
> -        * We should be on that channel for at least a minimum amount of
> +       /* We should be on that channel for at least a minimum amount of
>          * time (10ms) but no longer than the driver supports.
>          */
>         if (duration < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
> @@ -8586,8 +8553,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
>         if (!info->attrs[NL80211_ATTR_TX_RATES])
>                 goto out;
>
> -       /*
> -        * The nested attribute uses enum nl80211_band as the index. This maps
> +       /* The nested attribute uses enum nl80211_band as the index. This maps
>          * directly to the enum nl80211_band values used in cfg80211.
>          */
>         BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
> @@ -8736,8 +8702,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
>                         return -EINVAL;
>                 params.wait = nla_get_u32(info->attrs[NL80211_ATTR_DURATION]);
>
> -               /*
> -                * We should wait on the channel for at least a minimum amount
> +               /* We should wait on the channel for at least a minimum amount
>                  * of time (10ms) but no longer than the driver supports.
>                  */
>                 if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
> @@ -10758,8 +10723,7 @@ static int nl80211_tdls_channel_switch(struct sk_buff *skb,
>         if (err)
>                 return err;
>
> -       /*
> -        * Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
> +       /* Don't allow wide channels on the 2.4Ghz band, as per IEEE802.11-2012
>          * section 10.22.6.2.1. Disallow 5/10Mhz channels as well for now, the
>          * specification is not defined for them.
>          */
> @@ -11899,8 +11863,7 @@ nla_put_failure:
>         return false;
>  }
>
> -/*
> - * This can happen on global regulatory changes or device specific settings
> +/* This can happen on global regulatory changes or device specific settings
>   * based on custom regulatory domains.
>   */
>  void nl80211_common_reg_change_event(enum nl80211_commands cmd_id,
> @@ -12337,8 +12300,7 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
>                 return;
>         }
>
> -       /*
> -        * Since we are applying the beacon hint to a wiphy we know its
> +       /* Since we are applying the beacon hint to a wiphy we know its
>          * wiphy_idx is valid
>          */
>         if (nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy)))
> @@ -13453,8 +13415,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
>
>         rcu_read_unlock();
>
> -       /*
> -        * It is possible that the user space process that is controlling the
> +       /* It is possible that the user space process that is controlling the
>          * indoor setting disappeared, so notify the regulatory core.
>          */
>         regulatory_netlink_notify(notify->portid);
> --
> 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



-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] nl80211: Fix checkpatch warnings about blank lines
@ 2016-05-30  0:31     ` Julian Calaby
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:31 UTC (permalink / raw)
  To: Kirtika Ruchandani; +Cc: Johannes Berg, linux-wireless, ruchandani.tina, netdev

Hi All,

On Sun, May 29, 2016 at 1:31 PM, Kirtika Ruchandani
<kirtika.ruchandani@gmail.com> wrote:
> 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
>
> Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>

Looks sensible to me

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

Thanks,

Julian Calaby


> ---
>  net/wireless/nl80211.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 50a0de0..cd422bd 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -167,6 +167,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
>
>         if (attrs[NL80211_ATTR_IFINDEX]) {
>                 int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]);
> +
>                 netdev = __dev_get_by_index(netns, ifindex);
>                 if (netdev) {
>                         if (netdev->ieee80211_ptr)
> @@ -730,6 +731,7 @@ static int nl80211_parse_key_new(struct nlattr *key, struct key_parse *k)
>
>         if (tb[NL80211_KEY_DEFAULT_TYPES]) {
>                 struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES];
> +
>                 err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1,
>                                        tb[NL80211_KEY_DEFAULT_TYPES],
>                                        nl80211_key_default_policy);
> @@ -1381,6 +1383,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
>                     rdev->ops->get_antenna) {
>                         u32 tx_ant = 0, rx_ant = 0;
>                         int res;
> +
>                         res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
>                         if (!res) {
>                                 if (nla_put_u32(msg,
> @@ -2111,7 +2114,6 @@ static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info)
>         return rdev_set_wds_peer(rdev, dev, bssid);
>  }
>
> -
>  static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>  {
>         struct cfg80211_registered_device *rdev;
> @@ -2244,6 +2246,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>         if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
>             info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
>                 u32 tx_ant, rx_ant;
> +
>                 if ((!rdev->wiphy.available_antennas_tx &&
>                      !rdev->wiphy.available_antennas_rx) ||
>                     !rdev->ops->set_antenna)
> @@ -2910,6 +2913,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
>         pairwise = !!mac_addr;
>         if (info->attrs[NL80211_ATTR_KEY_TYPE]) {
>                 u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
> +
>                 if (kt >= NUM_NL80211_KEYTYPES)
>                         return -EINVAL;
>                 if (kt != NL80211_KEYTYPE_GROUP &&
> @@ -3949,7 +3953,6 @@ static int nl80211_dump_station(struct sk_buff *skb,
>                 sta_idx++;
>         }
>
> -
>   out:
>         cb->args[2] = sta_idx;
>         err = skb->len;
> @@ -4742,7 +4745,6 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
>                 path_idx++;
>         }
>
> -
>   out:
>         cb->args[2] = path_idx;
>         err = skb->len;
> @@ -5032,7 +5034,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;
>         u32 owner_nlportid;
>
> -
>         /* You should only get this when cfg80211 hasn't yet initialized
>          * completely when built-in to the kernel right between the time
>          * window between nl80211_init() and regulatory_init(), if that is
> @@ -5240,7 +5241,6 @@ do {                                                                          \
>         }                                                                   \
>  } while (0)
>
> -
>         if (!info->attrs[NL80211_ATTR_MESH_CONFIG])
>                 return -EINVAL;
>         if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX,
> @@ -5388,7 +5388,6 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
>                  IEEE80211_PATH_METRIC_VENDOR :
>                  IEEE80211_PATH_METRIC_AIRTIME;
>
> -
>         if (tb[NL80211_MESH_SETUP_IE]) {
>                 struct nlattr *ieattr =
>                         tb[NL80211_MESH_SETUP_IE];
> @@ -6009,6 +6008,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
>                 /* all channels */
>                 for (band = 0; band < NUM_NL80211_BANDS; band++) {
>                         int j;
> +
>                         if (!wiphy->bands[band])
>                                 continue;
>                         for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
> @@ -6412,6 +6412,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
>                 /* all channels */
>                 for (band = 0; band < NUM_NL80211_BANDS; band++) {
>                         int j;
> +
>                         if (!wiphy->bands[band])
>                                 continue;
>                         for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
> @@ -7174,6 +7175,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
>         if (key.idx >= 0) {
>                 int i;
>                 bool ok = false;
> +
>                 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
>                         if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
>                                 ok = true;
> @@ -7251,6 +7253,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
>
>         if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) {
>                 u16 proto;
> +
>                 proto = nla_get_u16(
>                         info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]);
>                 settings->control_port_ethertype = cpu_to_be16(proto);
> @@ -8402,6 +8405,7 @@ static u32 rateset_to_mask(struct ieee80211_supported_band *sband,
>         for (i = 0; i < rates_len; i++) {
>                 int rate = (rates[i] & 0x7f) * 5;
>                 int ridx;
> +
>                 for (ridx = 0; ridx < sband->n_bitrates; ridx++) {
>                         struct ieee80211_rate *srate =
>                                 &sband->bitrates[ridx];
> @@ -8708,7 +8712,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
>                 if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
>                     params.wait > rdev->wiphy.max_remain_on_channel_duration)
>                         return -EINVAL;
> -
>         }
>
>         params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
> @@ -10555,7 +10558,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
>  }
>  EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
>
> -
>  static int nl80211_set_qos_map(struct sk_buff *skb,
>                                struct genl_info *info)
>  {
> @@ -12089,7 +12091,6 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
> @@ -12128,7 +12129,6 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
> @@ -12166,7 +12166,6 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
> @@ -13506,7 +13505,6 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
>         if (hdr)
>                 genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>  EXPORT_SYMBOL(cfg80211_crit_proto_stopped);
>
> --
> 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



-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] nl80211: Fix checkpatch warnings about blank lines
@ 2016-05-30  0:31     ` Julian Calaby
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:31 UTC (permalink / raw)
  To: Kirtika Ruchandani
  Cc: Johannes Berg, linux-wireless,
	ruchandani.tina-Re5JQEeQqe8AvxtiuMwx3w, netdev

Hi All,

On Sun, May 29, 2016 at 1:31 PM, Kirtika Ruchandani
<kirtika.ruchandani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 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
>
> Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Looks sensible to me

Reviewed-by: Julian Calaby <julian.calaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Thanks,

Julian Calaby


> ---
>  net/wireless/nl80211.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 50a0de0..cd422bd 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -167,6 +167,7 @@ __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
>
>         if (attrs[NL80211_ATTR_IFINDEX]) {
>                 int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]);
> +
>                 netdev = __dev_get_by_index(netns, ifindex);
>                 if (netdev) {
>                         if (netdev->ieee80211_ptr)
> @@ -730,6 +731,7 @@ static int nl80211_parse_key_new(struct nlattr *key, struct key_parse *k)
>
>         if (tb[NL80211_KEY_DEFAULT_TYPES]) {
>                 struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES];
> +
>                 err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1,
>                                        tb[NL80211_KEY_DEFAULT_TYPES],
>                                        nl80211_key_default_policy);
> @@ -1381,6 +1383,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
>                     rdev->ops->get_antenna) {
>                         u32 tx_ant = 0, rx_ant = 0;
>                         int res;
> +
>                         res = rdev_get_antenna(rdev, &tx_ant, &rx_ant);
>                         if (!res) {
>                                 if (nla_put_u32(msg,
> @@ -2111,7 +2114,6 @@ static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info)
>         return rdev_set_wds_peer(rdev, dev, bssid);
>  }
>
> -
>  static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>  {
>         struct cfg80211_registered_device *rdev;
> @@ -2244,6 +2246,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>         if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
>             info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
>                 u32 tx_ant, rx_ant;
> +
>                 if ((!rdev->wiphy.available_antennas_tx &&
>                      !rdev->wiphy.available_antennas_rx) ||
>                     !rdev->ops->set_antenna)
> @@ -2910,6 +2913,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
>         pairwise = !!mac_addr;
>         if (info->attrs[NL80211_ATTR_KEY_TYPE]) {
>                 u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
> +
>                 if (kt >= NUM_NL80211_KEYTYPES)
>                         return -EINVAL;
>                 if (kt != NL80211_KEYTYPE_GROUP &&
> @@ -3949,7 +3953,6 @@ static int nl80211_dump_station(struct sk_buff *skb,
>                 sta_idx++;
>         }
>
> -
>   out:
>         cb->args[2] = sta_idx;
>         err = skb->len;
> @@ -4742,7 +4745,6 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
>                 path_idx++;
>         }
>
> -
>   out:
>         cb->args[2] = path_idx;
>         err = skb->len;
> @@ -5032,7 +5034,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;
>         u32 owner_nlportid;
>
> -
>         /* You should only get this when cfg80211 hasn't yet initialized
>          * completely when built-in to the kernel right between the time
>          * window between nl80211_init() and regulatory_init(), if that is
> @@ -5240,7 +5241,6 @@ do {                                                                          \
>         }                                                                   \
>  } while (0)
>
> -
>         if (!info->attrs[NL80211_ATTR_MESH_CONFIG])
>                 return -EINVAL;
>         if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX,
> @@ -5388,7 +5388,6 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
>                  IEEE80211_PATH_METRIC_VENDOR :
>                  IEEE80211_PATH_METRIC_AIRTIME;
>
> -
>         if (tb[NL80211_MESH_SETUP_IE]) {
>                 struct nlattr *ieattr =
>                         tb[NL80211_MESH_SETUP_IE];
> @@ -6009,6 +6008,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
>                 /* all channels */
>                 for (band = 0; band < NUM_NL80211_BANDS; band++) {
>                         int j;
> +
>                         if (!wiphy->bands[band])
>                                 continue;
>                         for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
> @@ -6412,6 +6412,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
>                 /* all channels */
>                 for (band = 0; band < NUM_NL80211_BANDS; band++) {
>                         int j;
> +
>                         if (!wiphy->bands[band])
>                                 continue;
>                         for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
> @@ -7174,6 +7175,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
>         if (key.idx >= 0) {
>                 int i;
>                 bool ok = false;
> +
>                 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
>                         if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
>                                 ok = true;
> @@ -7251,6 +7253,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
>
>         if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) {
>                 u16 proto;
> +
>                 proto = nla_get_u16(
>                         info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]);
>                 settings->control_port_ethertype = cpu_to_be16(proto);
> @@ -8402,6 +8405,7 @@ static u32 rateset_to_mask(struct ieee80211_supported_band *sband,
>         for (i = 0; i < rates_len; i++) {
>                 int rate = (rates[i] & 0x7f) * 5;
>                 int ridx;
> +
>                 for (ridx = 0; ridx < sband->n_bitrates; ridx++) {
>                         struct ieee80211_rate *srate =
>                                 &sband->bitrates[ridx];
> @@ -8708,7 +8712,6 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
>                 if (params.wait < NL80211_MIN_REMAIN_ON_CHANNEL_TIME ||
>                     params.wait > rdev->wiphy.max_remain_on_channel_duration)
>                         return -EINVAL;
> -
>         }
>
>         params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK];
> @@ -10555,7 +10558,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
>  }
>  EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
>
> -
>  static int nl80211_set_qos_map(struct sk_buff *skb,
>                                struct genl_info *info)
>  {
> @@ -12089,7 +12091,6 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
> @@ -12128,7 +12129,6 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
> @@ -12166,7 +12166,6 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
>   nla_put_failure:
>         genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>
>  void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
> @@ -13506,7 +13505,6 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
>         if (hdr)
>                 genlmsg_cancel(msg, hdr);
>         nlmsg_free(msg);
> -
>  }
>  EXPORT_SYMBOL(cfg80211_crit_proto_stopped);
>
> --
> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Julian Calaby

Email: julian.calaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] nl80211: Various checkpatch.pl fixes
  2016-05-29  3:31 ` [PATCH 3/3] nl80211: Various checkpatch.pl fixes Kirtika Ruchandani
@ 2016-05-30  0:35   ` Julian Calaby
  2016-05-30  0:40     ` Kirtika Ruchandani
  0 siblings, 1 reply; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:35 UTC (permalink / raw)
  To: Kirtika Ruchandani; +Cc: Johannes Berg, linux-wireless, ruchandani.tina, netdev

Hi Kirtika,

On Sun, May 29, 2016 at 1:31 PM, Kirtika Ruchandani
<kirtika.ruchandani@gmail.com> wrote:
> This patch fixes the following checkpatch.pl issues -

There's too much stuff here to quickly review, it'd be nice if you
could split this up into patches that do the following:

Space issues:
> - space preferred around that <operator>
> - no space needed after cast.
> - Alignment should match open parenthesis
> - suspect code indent for conditional statements
> - Statements should start on a tabstop

Braces:
> - braces {} should be used on all arms of this statement

Multiple assignments:
> - multiple assignments should be avoided

ether_addr_copy:
> - prefer ether_addr_copy over memcpy

Spelling:
> - correct spelling - 'implementation'

NULL comparisons:
> - comparison to NULL could be written as !foo

kcalloc vs kzalloc:
> - prefer kcalloc over kzalloc with multiply

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] nl80211: Various checkpatch.pl fixes
  2016-05-30  0:35   ` Julian Calaby
@ 2016-05-30  0:40     ` Kirtika Ruchandani
  2016-05-30  0:44       ` Kirtika Ruchandani
  0 siblings, 1 reply; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-30  0:40 UTC (permalink / raw)
  To: Julian Calaby; +Cc: Johannes Berg, linux-wireless, Tina Ruchandani, netdev

> There's too much stuff here to quickly review, it'd be nice if you
> could split this up into patches that do the following:

Thanks, I will send out a v2 with the split you suggested.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] nl80211: Various checkpatch.pl fixes
  2016-05-30  0:40     ` Kirtika Ruchandani
@ 2016-05-30  0:44       ` Kirtika Ruchandani
  2016-05-30  0:47           ` Julian Calaby
  0 siblings, 1 reply; 14+ messages in thread
From: Kirtika Ruchandani @ 2016-05-30  0:44 UTC (permalink / raw)
  To: Julian Calaby; +Cc: Johannes Berg, linux-wireless, Tina Ruchandani, netdev

>> There's too much stuff here to quickly review, it'd be nice if you
>> could split this up into patches that do the following:

Is it preferable to resend the whole patch-set or just patch 3/3 in
this one as a separate set?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] nl80211: Various checkpatch.pl fixes
@ 2016-05-30  0:47           ` Julian Calaby
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:47 UTC (permalink / raw)
  To: Kirtika Ruchandani; +Cc: Johannes Berg, linux-wireless, Tina Ruchandani, netdev

Hi Kirtika,

On Mon, May 30, 2016 at 10:44 AM, Kirtika Ruchandani
<kirtika.ruchandani@gmail.com> wrote:
>>> There's too much stuff here to quickly review, it'd be nice if you
>>> could split this up into patches that do the following:
>
> Is it preferable to resend the whole patch-set or just patch 3/3 in
> this one as a separate set?

Re-send the entire set, make sure you mark it as v2, include a
changelog in the cover letter or below the "---" in the patches
themselves, and don't forget to include the reviewed-bys for any
unchanged patches.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] nl80211: Various checkpatch.pl fixes
@ 2016-05-30  0:47           ` Julian Calaby
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Calaby @ 2016-05-30  0:47 UTC (permalink / raw)
  To: Kirtika Ruchandani; +Cc: Johannes Berg, linux-wireless, Tina Ruchandani, netdev

Hi Kirtika,

On Mon, May 30, 2016 at 10:44 AM, Kirtika Ruchandani
<kirtika.ruchandani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> There's too much stuff here to quickly review, it'd be nice if you
>>> could split this up into patches that do the following:
>
> Is it preferable to resend the whole patch-set or just patch 3/3 in
> this one as a separate set?

Re-send the entire set, make sure you mark it as v2, include a
changelog in the cover letter or below the "---" in the patches
themselves, and don't forget to include the reviewed-bys for any
unchanged patches.

Thanks,

-- 
Julian Calaby

Email: julian.calaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] nl80211: Fix checkpatch warnings
  2016-05-30  0:30   ` Julian Calaby
@ 2016-05-31 10:29     ` Johannes Berg
  0 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2016-05-31 10:29 UTC (permalink / raw)
  To: Julian Calaby; +Cc: linux-wireless, Kirtika Ruchandani, ruchandani.tina, netdev

On Mon, 2016-05-30 at 10:30 +1000, Julian Calaby wrote:
> Hi All,
> 
> On Sun, May 29, 2016 at 1:30 PM, Kirtika Ruchandani
> <kirtika.ruchandani@gmail.com> wrote:
> > 
> > This patch fixes the following checkpatch.pl warnings about
> > comments in nl80211.c :
> > - networking block comments don't use an empty '/*' line
> > - block comments use a trailing '*/' on a separate line
> > 
> > Signed-off-by: Kirtika Ruchandani <kirtika.ruchandani@gmail.com>
> The change and logic behind it are sound, so it gets my:
> 
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
> 
> however I'm concerned that this file is a deliberate exception to the
> networking comment rules.
> 

It's kinda mixed, I never really enforced one style or the other ...
I'm kinda taking both now, with a slight preference towards the
networking style perhaps (to please davem :) )

That said, in general I'm not really sure of the value of all of these
patches - perhaps the kcalloc() one makes sense, not for checkpatch
reasons but rather for size limit/integer overflow reasons, and the
ether address assign for general readability, but overall ...

I'll have to make up my mind :)

johannes

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-05-31 10:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-29  3:30 [PATCH 0/3] nl80211: Fix checkpatch.pl issues Kirtika Ruchandani
2016-05-29  3:30 ` [PATCH 1/3] nl80211: Fix checkpatch warnings Kirtika Ruchandani
2016-05-29  3:30   ` Kirtika Ruchandani
2016-05-30  0:30   ` Julian Calaby
2016-05-31 10:29     ` Johannes Berg
2016-05-29  3:31 ` [PATCH 2/3] nl80211: Fix checkpatch warnings about blank lines Kirtika Ruchandani
2016-05-30  0:31   ` Julian Calaby
2016-05-30  0:31     ` Julian Calaby
2016-05-29  3:31 ` [PATCH 3/3] nl80211: Various checkpatch.pl fixes Kirtika Ruchandani
2016-05-30  0:35   ` Julian Calaby
2016-05-30  0:40     ` Kirtika Ruchandani
2016-05-30  0:44       ` Kirtika Ruchandani
2016-05-30  0:47         ` Julian Calaby
2016-05-30  0:47           ` Julian Calaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.