Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159431
b: refs/heads/master
c: 6b4f645
h: refs/heads/master
i:
  159429: 241b167
  159427: 3dc3c6e
  159423: 64c5b3a
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent 2c8ab75 commit 5dc8baa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3b90ca28412fb9dcc8c5ca38e179e78fec07eee
refs/heads/master: 6b4f645a491ac29c7dced415d034eea7736155a6
13 changes: 9 additions & 4 deletions trunk/drivers/net/wireless/ath/ath9k/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2892,7 +2892,6 @@ static bool ath9k_hw_AR9287_fill_eeprom(struct ath_hw *ah)
}
static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
{
#define SIZE_EEPROM_87 (sizeof(struct ar9287_eeprom) / sizeof(u16))
u32 sum = 0, el, integer;
u16 temp, word, magic, magic2, *eepdata;
int i, addr;
Expand All @@ -2918,7 +2917,9 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
need_swap = true;
eepdata = (u16 *)(&ah->eeprom);

for (addr = 0; addr < SIZE_EEPROM_87; addr++) {
for (addr = 0;
addr < sizeof(struct ar9287_eeprom) / sizeof(u16);
addr++) {
temp = swab16(*eepdata);
*eepdata = temp;
eepdata++;
Expand All @@ -2938,8 +2939,13 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
else
el = ah->eeprom.map9287.baseEepHeader.length;

if (el > sizeof(struct ar9287_eeprom))
el = sizeof(struct ar9287_eeprom) / sizeof(u16);
else
el = el / sizeof(u16);

eepdata = (u16 *)(&ah->eeprom);
for (i = 0; i < min(el, SIZE_EEPROM_87); i++)
for (i = 0; i < el; i++)
sum ^= *eepdata++;

if (need_swap) {
Expand Down Expand Up @@ -2990,7 +2996,6 @@ static int ath9k_hw_AR9287_check_eeprom(struct ath_hw *ah)
}

return 0;
#undef SIZE_EEPROM_87
}

static u32 ath9k_hw_AR9287_get_eeprom(struct ath_hw *ah,
Expand Down

0 comments on commit 5dc8baa

Please sign in to comment.