Skip to content

Commit f09e3b7

Browse files
committed
wifi: ath9k: eeprom: fix sparse endian warnings
Sparse warns: drivers/net/wireless/ath/ath9k/eeprom_9287.c:82:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_9287.c:82:9: warning: cast from restricted __le32 drivers/net/wireless/ath/ath9k/eeprom_9287.c:83:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_9287.c:83:9: warning: cast from restricted __le32 drivers/net/wireless/ath/ath9k/eeprom_def.c:138:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_def.c:138:9: warning: cast from restricted __le32 drivers/net/wireless/ath/ath9k/eeprom_def.c:139:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_def.c:139:9: warning: cast from restricted __le32 drivers/net/wireless/ath/ath9k/eeprom_def.c:140:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_def.c:140:9: warning: cast from restricted __le32 drivers/net/wireless/ath/ath9k/eeprom_4k.c:79:9: warning: cast to restricted __le16 drivers/net/wireless/ath/ath9k/eeprom_4k.c:79:9: warning: cast from restricted __le32 antCtrlChain is an array of __le32 so le32_to_cpu() needs to be used. Compile tested only. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Link: https://msgid.link/20240320170656.3534265-4-kvalo@kernel.org
1 parent a854028 commit f09e3b7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/net/wireless/ath/ath9k/eeprom_4k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
7676
static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size,
7777
struct modal_eep_4k_header *modal_hdr)
7878
{
79-
PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
79+
PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
8080
PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
8181
PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
8282
PR_EEP("Switch Settle", modal_hdr->switchSettling);

drivers/net/wireless/ath/ath9k/eeprom_9287.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
7979
static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size,
8080
struct modal_eep_ar9287_header *modal_hdr)
8181
{
82-
PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
83-
PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1]));
82+
PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
83+
PR_EEP("Chain1 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[1]));
8484
PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
8585
PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
8686
PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]);

drivers/net/wireless/ath/ath9k/eeprom_def.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
135135
static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size,
136136
struct modal_eep_header *modal_hdr)
137137
{
138-
PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
139-
PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1]));
140-
PR_EEP("Chain2 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[2]));
138+
PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
139+
PR_EEP("Chain1 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[1]));
140+
PR_EEP("Chain2 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[2]));
141141
PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
142142
PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
143143
PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]);

0 commit comments

Comments
 (0)