mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 03/12] net: mac80211: Use global ether_broadcast_addr
Date: Sat, 31 Mar 2018 00:05:18 -0700	[thread overview]
Message-ID: <ed4a07fafa3349c0ea8eae8d049a66e8954eee47.1522479607.git.joe@perches.com> (raw)
In-Reply-To: <cover.1522479607.git.joe@perches.com>

Remove statics and use the new global ether_broadcast_addr instead
to save some overall object code size.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/mac80211/iface.c        |  5 +----
 net/mac80211/key.c          |  6 ++----
 net/mac80211/mesh_hwmp.c    | 19 ++++++++++---------
 net/mac80211/mesh_pathtbl.c |  8 ++++----
 4 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index d13ba064951f..f203efc3c532 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1387,9 +1387,6 @@ static void ieee80211_recalc_smps_work(struct work_struct *work)
 static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
 				  enum nl80211_iftype type)
 {
-	static const u8 bssid_wildcard[ETH_ALEN] = {0xff, 0xff, 0xff,
-						    0xff, 0xff, 0xff};
-
 	/* clear type-dependent union */
 	memset(&sdata->u, 0, sizeof(sdata->u));
 
@@ -1442,7 +1439,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
 		ieee80211_sta_setup_sdata(sdata);
 		break;
 	case NL80211_IFTYPE_OCB:
-		sdata->vif.bss_conf.bssid = bssid_wildcard;
+		sdata->vif.bss_conf.bssid = ether_broadcast_addr;
 		ieee80211_ocb_setup_sdata(sdata);
 		break;
 	case NL80211_IFTYPE_ADHOC:
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index aee05ec3f7ea..429f0f4bdc0d 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -53,8 +53,6 @@
  * remove the key which waits for an RCU grace period.
  */
 
-static const u8 bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-
 static void assert_key_lock(struct ieee80211_local *local)
 {
 	lockdep_assert_held(&local->key_mtx);
@@ -196,7 +194,7 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
 		sdata_err(sdata,
 			  "failed to set key (%d, %pM) to hardware (%d)\n",
 			  key->conf.keyidx,
-			  sta ? sta->sta.addr : bcast_addr, ret);
+			  sta ? sta->sta.addr : ether_broadcast_addr, ret);
 
  out_unsupported:
 	switch (key->conf.cipher) {
@@ -253,7 +251,7 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
 		sdata_err(sdata,
 			  "failed to remove key (%d, %pM) from hardware (%d)\n",
 			  key->conf.keyidx,
-			  sta ? sta->sta.addr : bcast_addr, ret);
+			  sta ? sta->sta.addr : ether_broadcast_addr, ret);
 
 	key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
 }
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 35ad3983ae4b..23027ea80593 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -97,8 +97,6 @@ enum mpath_frame_type {
 	MPATH_RANN
 };
 
-static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
 static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
 				  const u8 *orig_addr, u32 orig_sn,
 				  u8 target_flags, const u8 *target,
@@ -645,7 +643,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
 		preq_id = PREQ_IE_PREQ_ID(preq_elem);
 		hopcount = PREQ_IE_HOPCOUNT(preq_elem) + 1;
 		da = (mpath && mpath->is_root) ?
-			mpath->rann_snd_addr : broadcast_addr;
+			mpath->rann_snd_addr : ether_broadcast_addr;
 
 		if (flags & IEEE80211_PREQ_PROACTIVE_PREP_FLAG) {
 			target_addr = PREQ_IE_TARGET_ADDR(preq_elem);
@@ -779,7 +777,7 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
 				goto endperr;
 			mesh_path_error_tx(sdata, ttl, target_addr,
 					   target_sn, target_rcode,
-					   broadcast_addr);
+					   ether_broadcast_addr);
 		} else
 			spin_unlock_bh(&mpath->state_lock);
 	}
@@ -877,7 +875,8 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
 
 	if (ifmsh->mshcfg.dot11MeshForwarding) {
 		mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
-				       orig_sn, 0, NULL, 0, broadcast_addr,
+				       orig_sn, 0, NULL, 0,
+				       ether_broadcast_addr,
 				       hopcount, ttl, interval,
 				       new_metric, 0, sdata);
 	}
@@ -1080,7 +1079,7 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata)
 		target_flags &= ~IEEE80211_PREQ_TO_FLAG;
 
 	spin_unlock_bh(&mpath->state_lock);
-	da = (mpath->is_root) ? mpath->rann_snd_addr : broadcast_addr;
+	da = (mpath->is_root) ? mpath->rann_snd_addr : ether_broadcast_addr;
 	mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn,
 			       target_flags, mpath->dst, mpath->sn, da, 0,
 			       ttl, lifetime, 0, ifmsh->preq_id++, sdata);
@@ -1244,7 +1243,8 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata)
 	switch (ifmsh->mshcfg.dot11MeshHWMPRootMode) {
 	case IEEE80211_PROACTIVE_RANN:
 		mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr,
-				       ++ifmsh->sn, 0, NULL, 0, broadcast_addr,
+				       ++ifmsh->sn, 0, NULL, 0,
+				       ether_broadcast_addr,
 				       0, ifmsh->mshcfg.element_ttl,
 				       interval, 0, 0, sdata);
 		break;
@@ -1257,8 +1257,9 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata)
 				IEEE80211_PREQ_USN_FLAG;
 		mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr,
 				       ++ifmsh->sn, target_flags,
-				       (u8 *) broadcast_addr, 0, broadcast_addr,
-				       0, ifmsh->mshcfg.element_ttl, interval,
+				       ether_broadcast_addr, 0,
+				       ether_broadcast_addr, 0,
+				       ifmsh->mshcfg.element_ttl, interval,
 				       0, ifmsh->preq_id++, sdata);
 		break;
 	default:
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index a5125624a76d..8b16f7315fac 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -501,7 +501,6 @@ void mesh_plink_broken(struct sta_info *sta)
 {
 	struct ieee80211_sub_if_data *sdata = sta->sdata;
 	struct mesh_table *tbl = sdata->u.mesh.mesh_paths;
-	static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 	struct mesh_path *mpath;
 	struct rhashtable_iter iter;
 	int ret;
@@ -525,9 +524,10 @@ void mesh_plink_broken(struct sta_info *sta)
 			++mpath->sn;
 			spin_unlock_bh(&mpath->state_lock);
 			mesh_path_error_tx(sdata,
-				sdata->u.mesh.mshcfg.element_ttl,
-				mpath->dst, mpath->sn,
-				WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast);
+					   sdata->u.mesh.mshcfg.element_ttl,
+					   mpath->dst, mpath->sn,
+					   WLAN_REASON_MESH_PATH_DEST_UNREACHABLE,
+					   ether_broadcast_addr);
 		}
 	}
 	rhashtable_walk_stop(&iter);
-- 
2.15.0

  parent reply	other threads:[~2018-03-31  7:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  7:05 [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Joe Perches
2018-03-31  7:05 ` [PATCH 01/12] ethernet: Add generic ether_<foo>_addr addresses Joe Perches
2018-03-31  7:05 ` [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
2018-03-31 17:36   ` Andrew Lunn
2018-03-31 18:01     ` Joe Perches
2018-03-31 18:34     ` [PATCH V2] " Joe Perches
2018-04-01 18:07       ` David Miller
2018-04-01  0:18   ` [PATCH 02/12] " kbuild test robot
2018-03-31  7:05 ` Joe Perches [this message]
2018-03-31  7:05 ` [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays Joe Perches
2018-03-31 18:28   ` Pablo Neira Ayuso
2018-03-31 18:40     ` Joe Perches
2018-03-31  7:05 ` [PATCH 05/12] net: atm: Use ether_broadcast_addr Joe Perches
2018-03-31  7:05 ` [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address Joe Perches
2018-03-31 14:01   ` Pkshih
2018-03-31 14:33     ` Joe Perches
2018-04-05 12:39   ` Kalle Valo
2018-04-05 12:48     ` Kalle Valo
2018-03-31  7:05 ` [PATCH 07/12] brcmfmac: Convert ALLFFMAC to ether_broadcast_addr Joe Perches
2018-04-05 19:00   ` Arend van Spriel
2018-03-31  7:05 ` [PATCH 08/12] iwlegacy: Remove EXPORT_SYMBOL(il_bcast_addr) and use ether_broadcast_addr Joe Perches
2018-03-31  7:05 ` [PATCH 09/12] iwlwifi: Remove local iwl_bcast_addr " Joe Perches
2018-07-07  7:40   ` Luciano Coelho
2018-09-07 10:46     ` Luciano Coelho
2018-03-31  7:05 ` [PATCH 10/12] mvpp2: Use ether_broadcast_addr instead of a local array Joe Perches
2018-03-31  7:05 ` [PATCH 11/12] qlogic: Convert local bcast_addr to global ether_broadcast_addr Joe Perches
2018-03-31  7:05 ` [PATCH 12/12] ethernet: Use ether_zero_addr instead of local statics Joe Perches
2018-04-05 13:27 ` [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Felix Fietkau
2018-04-05 13:51   ` Joe Perches
2018-04-05 14:05     ` Felix Fietkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed4a07fafa3349c0ea8eae8d049a66e8954eee47.1522479607.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®