svn commit: r300232 - head/sys/net80211

Andriy Voskoboinyk avos at FreeBSD.org
Thu May 19 21:08:35 UTC 2016


Author: avos
Date: Thu May 19 21:08:33 2016
New Revision: 300232
URL: https://svnweb.freebsd.org/changeset/base/300232

Log:
  net80211: fix more compiler warnings.
  
  ieee80211.c:
  	add_chanlist(): 'error' variable will be uninitialized if
  	                no channels were passed; return '0' instead.
  ieee80211_action.c:
  	ieee80211_send_action_register(): drop 'break' after 'return'.
  ieee80211_crypto_none.c:
  	none_encap(): 'keyid' is not used in non-debug builds; hide it
  	              behind IEEE80211_DEBUG ifdef.
  ieee80211_freebsd.c:
  	Staticize global 'ieee80211_debug' variable (used only in this
  	file).
  ieee80211_hostap.c:
  	Fix a comment (associatio -> association).
  ieee80211_ht.c:
  	ieee80211_setup_htrates(): initialize 'maxunequalmcs' to 0 to mute
  	                           compiler warning.
  ieee80211_hwmp.c:
  	hwmp_recv_preq(): copy 'prep' between conditional blocks to fix
  			  -Wshadow warning.
  ieee80211_mesh.c:
  	mesh_newstate(): remove duplicate 'ni' definition.
  	mesh_recv_group_data(): fix -Wempty-body warning in non-debug
  				builds.
  ieee80211_phy.c:
  	ieee80211_compute_duration(): remove 'break' after panic() call.
  ieee80211_scan_sta.c:
  	Hide some TDMA-specific macros under IEEE80211_SUPPORT_TDMA ifdef
  	adhoc_pick_bss(): remove 'ic' pointer redefinition.
  ieee80211_sta.c:
  	sta_beacon_miss(): remove 'ic' pointer redefinition.
  ieee80211_superg.c:
  	superg_ioctl_set80211(): drop unreachable return.
  
  Tested with clang 3.8.0, gcc 4.6.4 and gcc 5.3.0.

Modified:
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_action.c
  head/sys/net80211/ieee80211_crypto_none.c
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_hwmp.c
  head/sys/net80211/ieee80211_mesh.c
  head/sys/net80211/ieee80211_phy.c
  head/sys/net80211/ieee80211_scan_sta.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_superg.c

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211.c	Thu May 19 21:08:33 2016	(r300232)
@@ -1207,7 +1207,7 @@ add_chanlist(struct ieee80211_channel ch
 		}
 	}
 
-	return (error);
+	return (0);
 }
 
 int

Modified: head/sys/net80211/ieee80211_action.c
==============================================================================
--- head/sys/net80211/ieee80211_action.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_action.c	Thu May 19 21:08:33 2016	(r300232)
@@ -103,7 +103,6 @@ ieee80211_send_action_register(int cat, 
 			break;
 		meshaction_send_action[act] = f;
 		return 0;
-		break;
 	case IEEE80211_ACTION_CAT_VENDOR:
 		if (act >= nitems(vendor_send_action))
 			break;

Modified: head/sys/net80211/ieee80211_crypto_none.c
==============================================================================
--- head/sys/net80211/ieee80211_crypto_none.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_crypto_none.c	Thu May 19 21:08:33 2016	(r300232)
@@ -101,7 +101,6 @@ none_encap(struct ieee80211_key *k, stru
 	struct ieee80211vap *vap = k->wk_private;
 #ifdef IEEE80211_DEBUG
 	struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
-#endif
 	uint8_t keyid;
 
 	keyid = ieee80211_crypto_get_keyid(vap, k);
@@ -112,6 +111,7 @@ none_encap(struct ieee80211_key *k, stru
 	 */
 	IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr1,
 	    "key id %u is not set (encap)", keyid);
+#endif
 	vap->iv_stats.is_tx_badcipher++;
 	return 0;
 }

Modified: head/sys/net80211/ieee80211_freebsd.c
==============================================================================
--- head/sys/net80211/ieee80211_freebsd.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_freebsd.c	Thu May 19 21:08:33 2016	(r300232)
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
 SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters");
 
 #ifdef IEEE80211_DEBUG
-int	ieee80211_debug = 0;
+static int	ieee80211_debug = 0;
 SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug,
 	    0, "debugging printfs");
 #endif

Modified: head/sys/net80211/ieee80211_hostap.c
==============================================================================
--- head/sys/net80211/ieee80211_hostap.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_hostap.c	Thu May 19 21:08:33 2016	(r300232)
@@ -1067,7 +1067,7 @@ hostap_auth_shared(struct ieee80211_node
 		 */
 		ni->ni_flags |= IEEE80211_NODE_AREF;
 		/*
-		 * Mark the node as requiring a valid associatio id
+		 * Mark the node as requiring a valid association id
 		 * before outbound traffic is permitted.
 		 */
 		ni->ni_flags |= IEEE80211_NODE_ASSOCID;

Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_ht.c	Thu May 19 21:08:33 2016	(r300232)
@@ -1643,6 +1643,7 @@ ieee80211_setup_htrates(struct ieee80211
 	int i, maxequalmcs, maxunequalmcs;
 
 	maxequalmcs = ic->ic_txstream * 8 - 1;
+	maxunequalmcs = 0;
 	if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) {
 		if (ic->ic_txstream >= 2)
 			maxunequalmcs = 38;
@@ -1650,8 +1651,7 @@ ieee80211_setup_htrates(struct ieee80211
 			maxunequalmcs = 52;
 		if (ic->ic_txstream >= 4)
 			maxunequalmcs = 76;
-	} else
-		maxunequalmcs = 0;
+	}
 
 	rs = &ni->ni_htrates;
 	memset(rs, 0, sizeof(*rs));

Modified: head/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- head/sys/net80211/ieee80211_hwmp.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_hwmp.c	Thu May 19 21:08:33 2016	(r300232)
@@ -944,7 +944,6 @@ hwmp_recv_preq(struct ieee80211vap *vap,
 	struct ieee80211_hwmp_route *hrorig = NULL;
 	struct ieee80211_hwmp_route *hrtarg = NULL;
 	struct ieee80211_hwmp_state *hs = vap->iv_hwmp;
-	struct ieee80211_meshprep_ie prep;
 	ieee80211_hwmp_seq preqid;	/* last seen preqid for orig */
 	uint32_t metric = 0;
 
@@ -1057,6 +1056,8 @@ hwmp_recv_preq(struct ieee80211vap *vap,
 	    IEEE80211_ADDR_EQ(vap->iv_myaddr, rttarg->rt_mesh_gate) &&
 	    rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY &&
 	    rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) {
+		struct ieee80211_meshprep_ie prep;
+
 		/*
 		 * When we are the target we shall update our own HWMP seq
 		 * number with max of (current and preq->seq) + 1
@@ -1139,6 +1140,8 @@ hwmp_recv_preq(struct ieee80211vap *vap,
 		 */
 		if ((rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 ||
 		    (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) {
+			struct ieee80211_meshprep_ie prep;
+
 			prep.prep_flags = 0;
 			prep.prep_hopcount = 0;
 			prep.prep_ttl = ms->ms_ttl;

Modified: head/sys/net80211/ieee80211_mesh.c
==============================================================================
--- head/sys/net80211/ieee80211_mesh.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_mesh.c	Thu May 19 21:08:33 2016	(r300232)
@@ -803,16 +803,15 @@ mesh_newstate(struct ieee80211vap *vap, 
 			 * Update bss node channel to reflect where
 			 * we landed after CSA.
 			 */
-			ieee80211_node_set_chan(vap->iv_bss,
+			ieee80211_node_set_chan(ni,
 			    ieee80211_ht_adjust_channel(ic, ic->ic_curchan,
-				ieee80211_htchanflags(vap->iv_bss->ni_chan)));
+				ieee80211_htchanflags(ni->ni_chan)));
 			/* XXX bypass debug msgs */
 			break;
 		case IEEE80211_S_SCAN:
 		case IEEE80211_S_RUN:
 #ifdef IEEE80211_DEBUG
 			if (ieee80211_msg_debug(vap)) {
-				struct ieee80211_node *ni = vap->iv_bss;
 				ieee80211_note(vap,
 				    "synchronized with %s meshid ",
 				    ether_sprintf(ni->ni_meshid));
@@ -827,7 +826,7 @@ mesh_newstate(struct ieee80211vap *vap, 
 		default:
 			break;
 		}
-		ieee80211_node_authorize(vap->iv_bss);
+		ieee80211_node_authorize(ni);
 		callout_reset(&ms->ms_cleantimer, ms->ms_ppath->mpp_inact,
                     mesh_rt_cleanup_cb, vap);
 		mesh_gatemode_setup(vap);
@@ -1510,10 +1509,11 @@ mesh_recv_group_data(struct ieee80211vap
 			 * will sent it on another port member.
 			 */
 			if (ms->ms_flags & IEEE80211_MESHFLAGS_GATE &&
-			    ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
+			    ms->ms_flags & IEEE80211_MESHFLAGS_FWD) {
 				IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH,
 				    MC01(mc)->mc_addr4, "%s",
 				    "forward from MBSS to the DS");
+			}
 		}
 	}
 	return (0); /* process locally */

Modified: head/sys/net80211/ieee80211_phy.c
==============================================================================
--- head/sys/net80211/ieee80211_phy.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_phy.c	Thu May 19 21:08:33 2016	(r300232)
@@ -563,7 +563,6 @@ ieee80211_compute_duration(const struct 
 	default:
 		panic("%s: unknown phy %u (rate %u)\n", __func__,
 		      rt->info[rix].phy, rate);
-		break;
 	}
 	return txTime;
 }

Modified: head/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_scan_sta.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_scan_sta.c	Thu May 19 21:08:33 2016	(r300232)
@@ -129,11 +129,13 @@ static void sta_flush_table(struct sta_t
 #define	MATCH_NOTSEEN		0x00080	/* not seen in recent scans */
 #define	MATCH_RSSI		0x00100	/* rssi deemed too low to use */
 #define	MATCH_CC		0x00200	/* country code mismatch */
+#ifdef IEEE80211_SUPPORT_TDMA
 #define	MATCH_TDMA_NOIE		0x00400	/* no TDMA ie */
 #define	MATCH_TDMA_NOTMASTER	0x00800	/* not TDMA master */
 #define	MATCH_TDMA_NOSLOT	0x01000	/* all TDMA slots occupied */
 #define	MATCH_TDMA_LOCAL	0x02000	/* local address */
 #define	MATCH_TDMA_VERSION	0x04000	/* protocol version mismatch */
+#endif
 #define	MATCH_MESH_NOID		0x10000	/* no MESHID ie */
 #define	MATCH_MESHID		0x20000	/* meshid mismatch */
 static int match_bss(struct ieee80211vap *,
@@ -1615,7 +1617,6 @@ notfound:
 			} else
 				chan = vap->iv_des_chan;
 			if (chan != NULL) {
-				struct ieee80211com *ic = vap->iv_ic;
 				/*
 				 * Create a HT capable IBSS; the per-node
 				 * probe request/response will result in

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_sta.c	Thu May 19 21:08:33 2016	(r300232)
@@ -154,7 +154,6 @@ sta_beacon_miss(struct ieee80211vap *vap
 	vap->iv_stats.is_beacon_miss++;
 	if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) {
 #ifdef IEEE80211_SUPPORT_SUPERG
-		struct ieee80211com *ic = vap->iv_ic;
 
 		/*
 		 * If we receive a beacon miss interrupt when using

Modified: head/sys/net80211/ieee80211_superg.c
==============================================================================
--- head/sys/net80211/ieee80211_superg.c	Thu May 19 21:04:59 2016	(r300231)
+++ head/sys/net80211/ieee80211_superg.c	Thu May 19 21:08:33 2016	(r300232)
@@ -1044,7 +1044,6 @@ superg_ioctl_set80211(struct ieee80211va
 	default:
 		return ENOSYS;
 	}
-	return 0;
 }
 IEEE80211_IOCTL_SET(superg, superg_ioctl_set80211);
 


More information about the svn-src-all mailing list