[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101126113503.GA28137@pma.sysgo.com>
Date: Fri, 26 Nov 2010 12:35:03 +0100
From: Pavel Machek <pma@...go.com>
To: Larry Finger <Larry.Finger@...inger.net>,
ath9k-devel@...ema.h4ckr.net, Sujith.Manoharan@...eros.com
Cc: kernel list <linux-kernel@...r.kernel.org>,
chunkeey@...glemail.com, linux-wireless@...r.kernel.org,
rudolf.marek@...go.com, cko@...go.com, mfa@...go.com, anl@...go.com
Subject: [PATCH] ath9k_htc: cleanup eeprom endiannes handling
There are already in-place byte swapping macros in Linux, use them.
Signed-off-by: Pavel Machek <pma@...go.com>
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 4fa4d8e..ee4e893 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -117,47 +117,25 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
sum ^= *eepdata++;
if (need_swap) {
- u32 integer;
- u16 word;
-
ath_print(common, ATH_DBG_EEPROM,
"EEPROM Endianness is not native.. Changing\n");
- word = swab16(eep->baseEepHeader.length);
- eep->baseEepHeader.length = word;
-
- word = swab16(eep->baseEepHeader.checksum);
- eep->baseEepHeader.checksum = word;
-
- word = swab16(eep->baseEepHeader.version);
- eep->baseEepHeader.version = word;
-
- word = swab16(eep->baseEepHeader.regDmn[0]);
- eep->baseEepHeader.regDmn[0] = word;
-
- word = swab16(eep->baseEepHeader.regDmn[1]);
- eep->baseEepHeader.regDmn[1] = word;
-
- word = swab16(eep->baseEepHeader.rfSilent);
- eep->baseEepHeader.rfSilent = word;
-
- word = swab16(eep->baseEepHeader.blueToothOptions);
- eep->baseEepHeader.blueToothOptions = word;
-
- word = swab16(eep->baseEepHeader.deviceCap);
- eep->baseEepHeader.deviceCap = word;
-
- integer = swab32(eep->modalHeader.antCtrlCommon);
- eep->modalHeader.antCtrlCommon = integer;
+ swab16s(&eep->baseEepHeader.length);
+ swab16s(&eep->baseEepHeader.checksum);
+ swab16s(&eep->baseEepHeader.version);
+ swab16s(&eep->baseEepHeader.regDmn[0]);
+ swab16s(&eep->baseEepHeader.regDmn[1]);
+ swab16s(&eep->baseEepHeader.rfSilent);
+ swab16s(&eep->baseEepHeader.blueToothOptions);
+ swab16s(&eep->baseEepHeader.deviceCap);
+ swab32s(&eep->modalHeader.antCtrlCommon);
for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) {
- integer = swab32(eep->modalHeader.antCtrlChain[i]);
- eep->modalHeader.antCtrlChain[i] = integer;
+ swab32s(&eep->modalHeader.antCtrlChain[i]);
}
for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
- word = swab16(eep->modalHeader.spurChans[i].spurChan);
- eep->modalHeader.spurChans[i].spurChan = word;
+ swab16s(&eep->modalHeader.spurChans[i].spurChan);
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists