Skip to contentSkip to conversation

wifi: wilc1000: fix sparse incorrect type in assignment warning

PATCH In review [email protected] 2 participants 2 messages Aug 30, 2023 – Feb 16, 2024 Microchip WILC1000 wifi driver

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 wifi: wilc1000: fix sparse incorrect type in assignment warning

From: Ajay Singh <[email protected]>

Remove unnecessary byte order conversion for 'key_mgmt_suite' since wpa_supplicant allows any byte order for AKM suite value. The change also helps avoid the below warning:

drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int key_mgmt_suite @@ got restricted __be32 [usertype] @@
drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: expected unsigned int key_mgmt_suite
drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: got restricted __be32 [usertype]

---
 drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +1 -1
index b545d93c6e37..390f325bc422 100644
@@ -359,7 +359,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
 			memcpy(vif->auth.ssid.ssid, sme->ssid, sme->ssid_len);
 			vif->auth.ssid.ssid_len = sme->ssid_len;
 		}
-		vif->auth.key_mgmt_suite = cpu_to_be32(sme->crypto.akm_suites[0]);
+		vif->auth.key_mgmt_suite = sme->crypto.akm_suites[0];
 		ether_addr_copy(vif->auth.bssid, sme->bssid);
 		break;
 

--
2.34.1

#1 lore raw
Quoted 6 lines · <[email protected]> wrote:

From: Ajay Singh <[email protected]>

Remove unnecessary byte order conversion for 'key_mgmt_suite' since wpa_supplicant allows any byte order for AKM suite value. The change also helps avoid the below warning:

Quoted 7 lines

drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int key_mgmt_suite @@ got restricted __be32 [usertype] @@
drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: expected unsigned int key_mgmt_suite
drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: got restricted __be32 [usertype]

New version available:

https://patchwork.kernel.org/project/linux-wireless/patch/20240215-nl80211_fix_akm_suites_endianness-v1-2-57e902632f9d@bootlin.com/

Patch set to Superseded.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches