]> Git Repo - J-linux.git/commitdiff
wifi: ath9k: eeprom: fix sparse endian warnings
authorKalle Valo <[email protected]>
Wed, 20 Mar 2024 17:06:56 +0000 (19:06 +0200)
committerKalle Valo <[email protected]>
Mon, 25 Mar 2024 10:51:37 +0000 (12:51 +0200)
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 <[email protected]>
Acked-by: Jeff Johnson <[email protected]>
Acked-by: Toke Høiland-Jørgensen <[email protected]>
Link: https://msgid.link/[email protected]
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c

index e8c2cc03be0cbef3822b7c04d9bbf81bc5f32d23..27b860b0c7694a4e5c763fd0cc2f907066f660a5 100644 (file)
@@ -76,7 +76,7 @@ static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
 static u32 ath9k_dump_4k_modal_eeprom(char *buf, u32 len, u32 size,
                                      struct modal_eep_4k_header *modal_hdr)
 {
-       PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
+       PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
        PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
        PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
        PR_EEP("Switch Settle", modal_hdr->switchSettling);
index fd5312c2a7e3033cbc9293348441e2f670422aa8..d85472ee4d85f33bf51afbb1add60bd2a7933442 100644 (file)
@@ -79,8 +79,8 @@ static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
 static u32 ar9287_dump_modal_eeprom(char *buf, u32 len, u32 size,
                                    struct modal_eep_ar9287_header *modal_hdr)
 {
-       PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
-       PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1]));
+       PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
+       PR_EEP("Chain1 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[1]));
        PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
        PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
        PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]);
index 7685f8ab371e6cee569bab6682f36a873cc5f5ae..84b31caf8ca6feb68905a47b4c00d49dade48cd9 100644 (file)
@@ -135,9 +135,9 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
 static u32 ath9k_def_dump_modal_eeprom(char *buf, u32 len, u32 size,
                                       struct modal_eep_header *modal_hdr)
 {
-       PR_EEP("Chain0 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[0]));
-       PR_EEP("Chain1 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[1]));
-       PR_EEP("Chain2 Ant. Control", le16_to_cpu(modal_hdr->antCtrlChain[2]));
+       PR_EEP("Chain0 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[0]));
+       PR_EEP("Chain1 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[1]));
+       PR_EEP("Chain2 Ant. Control", le32_to_cpu(modal_hdr->antCtrlChain[2]));
        PR_EEP("Ant. Common Control", le32_to_cpu(modal_hdr->antCtrlCommon));
        PR_EEP("Chain0 Ant. Gain", modal_hdr->antennaGainCh[0]);
        PR_EEP("Chain1 Ant. Gain", modal_hdr->antennaGainCh[1]);
This page took 0.060049 seconds and 4 git commands to generate.