wifi: iwlwifi: fix thermal code compilation with -Werror=cast-qual
authorBenjamin Berg <benjamin.berg@intel.com>
Tue, 6 May 2025 19:40:54 +0000 (22:40 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Fri, 9 May 2025 12:36:30 +0000 (15:36 +0300)
The compare_temps function in both mvm and mld dropped the const
qualifier in a cast in a way that makes -Werror=cast-qual unhappy. Add
the const to the cast to fix this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/thermal.c
drivers/net/wireless/intel/iwlwifi/mvm/tt.c

index 1909953a9be984c7b8237136b805bd624e5bbb27..f655fc04d949742f365a8befe208eba622b4ec9a 100644 (file)
@@ -116,8 +116,8 @@ free_resp:
 
 static int compare_temps(const void *a, const void *b)
 {
-       return ((s16)le16_to_cpu(*(__le16 *)a) -
-               (s16)le16_to_cpu(*(__le16 *)b));
+       return ((s16)le16_to_cpu(*(const __le16 *)a) -
+               (s16)le16_to_cpu(*(const __le16 *)b));
 }
 
 struct iwl_trip_walk_data {
index c851290e75a2404aefe0bfb08fe50a37c6562f0d..ed2f79abb82b4c8e468ab1b47db2cd0a7e06c85a 100644 (file)
@@ -552,8 +552,8 @@ int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 state)
 #ifdef CONFIG_THERMAL
 static int compare_temps(const void *a, const void *b)
 {
-       return ((s16)le16_to_cpu(*(__le16 *)a) -
-               (s16)le16_to_cpu(*(__le16 *)b));
+       return ((s16)le16_to_cpu(*(const __le16 *)a) -
+               (s16)le16_to_cpu(*(const __le16 *)b));
 }
 
 struct iwl_trip_walk_data {