linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: [PATCH 04/10] rt2x00: remove intf->mac field.
Date: Mon, 27 Dec 2010 15:05:35 +0100	[thread overview]
Message-ID: <201012271505.36104.IvDoorn@gmail.com> (raw)
In-Reply-To: <201012271505.15849.IvDoorn@gmail.com>

From: Gertjan van Wingerde <gwingerde@gmail.com>

The mac field of the rt2x00_intf structure is written to once and used
twice. In both these uses the mac address is available via other means.

Remove this field as it does not appear to be necessary.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00.h    |    5 -----
 drivers/net/wireless/rt2x00/rt2x00mac.c |    6 ++----
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 5f7f52f..755b723 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -360,11 +360,6 @@ struct rt2x00_intf {
 	spinlock_t lock;
 
 	/*
-	 * MAC of the device.
-	 */
-	u8 mac[ETH_ALEN];
-
-	/*
 	 * beacon->skb must be protected with the mutex.
 	 */
 	struct mutex beacon_skb_mutex;
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 23250a5..f8775c4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -282,9 +282,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 	 * STA interfaces at this time, since this can cause
 	 * invalid behavior in the device.
 	 */
-	memcpy(&intf->mac, vif->addr, ETH_ALEN);
 	rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
-			      intf->mac, NULL);
+			      vif->addr, NULL);
 
 	/*
 	 * Some filters depend on the current working mode. We can force
@@ -492,7 +491,6 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		      struct ieee80211_key_conf *key)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
-	struct rt2x00_intf *intf = vif_to_intf(vif);
 	int (*set_key) (struct rt2x00_dev *rt2x00dev,
 			struct rt2x00lib_crypto *crypto,
 			struct ieee80211_key_conf *key);
@@ -516,7 +514,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	if (rt2x00dev->intf_sta_count)
 		crypto.bssidx = 0;
 	else
-		crypto.bssidx = intf->mac[5] & (rt2x00dev->ops->max_ap_intf - 1);
+		crypto.bssidx = vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
 
 	crypto.cipher = rt2x00crypto_key_to_cipher(key);
 	if (crypto.cipher == CIPHER_NONE)
-- 
1.7.2.3


  reply	other threads:[~2010-12-27 14:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27 14:04 [PATCH 01/10] rt2x00: simplify txstatus_fifo handling Ivo van Doorn
2010-12-27 14:04 ` [PATCH 02/10] rt2x00: allow txstatus_fifo w/o txstatus_tasklet Ivo van Doorn
2010-12-27 14:05   ` [PATCH 03/10] rt2x00: Remove intf->bssid field Ivo van Doorn
2010-12-27 14:05     ` Ivo van Doorn [this message]
2010-12-27 14:05       ` [PATCH 05/10] rt2x00: Fix pointer errors Ivo van Doorn
2010-12-27 14:06         ` [PATCH 06/10] rt2x00: Fix panic on frame padding for rt2800 usb devices Ivo van Doorn
2010-12-27 14:06           ` [PATCH 07/10] rt2x00: Remove superfluous assignment of mpdu_density Ivo van Doorn
2010-12-27 14:06             ` [PATCH 08/10] rt2x00: Simplify intf->delayed_flags locking Ivo van Doorn
2010-12-27 14:07               ` [PATCH 09/10] rt2x00: Remove unused interface spinlock Ivo van Doorn
2010-12-27 14:07                 ` [PATCH 10/10] rt2x00: Fix comment about removed spinlock Ivo van Doorn

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=201012271505.36104.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /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;
as well as URLs for NNTP newsgroup(s).