Skip to contentSkip to conversation

rt2x00: Fix calculation of rt2800 iveiv entry offset.

PATCH In review Gertjan van Wingerde 2 participants 2 messages Dec 14, 2009 – Dec 15, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: Fix calculation of rt2800 iveiv entry offset.

Fix typo. The index should be multiplied by the entry size, not 'and'-ed.

Found via code-inspection.

---
 drivers/net/wireless/rt2x00/rt2800.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800.h +1 -1
index c5fe867..1a7eae3 100644
@@ -1323,7 +1323,7 @@
 #define PAIRWISE_KEY_ENTRY(__idx) \
 	( PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)) )
 #define MAC_IVEIV_ENTRY(__idx) \
-	( MAC_IVEIV_TABLE_BASE + ((__idx) & sizeof(struct mac_iveiv_entry)) )
+	( MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)) )
 #define MAC_WCID_ATTR_ENTRY(__idx) \
 	( MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)) )
 #define SHARED_KEY_ENTRY(__idx) \
Signature · 1 line
1.6.5.5
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Gertjan van Wingerde

Fix typo. The index should be multiplied by the entry size, not 'and'-ed.

Found via code-inspection.

Quoted 17 lines
---
 drivers/net/wireless/rt2x00/rt2800.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800.h +1 -1
index c5fe867..1a7eae3 100644
@@ -1323,7 +1323,7 @@
 #define PAIRWISE_KEY_ENTRY(__idx) \
 	( PAIRWISE_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry)) )
 #define MAC_IVEIV_ENTRY(__idx) \
-	( MAC_IVEIV_TABLE_BASE + ((__idx) & sizeof(struct mac_iveiv_entry)) )
+	( MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry)) )
 #define MAC_WCID_ATTR_ENTRY(__idx) \
 	( MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32)) )
 #define SHARED_KEY_ENTRY(__idx) \