Skip to content

Commit 2e171a5

Browse files
committed
iwlwifi: mvm: Drop unused fw_trips_index[] from iwl_mvm_thermal_device
The fw_trips_index[] array in struct iwl_mvm_thermal_device is only populated, but never read, so drop it. Note that the iwl_mvm_send_temp_report_ths_cmd() code populating fw_trips_index[] is questionable, because it accesses a trips table of a thermal zone directly, which is not guaranteed to work in the future. No functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Miri Korenblit <Miriam.rachel.korenblit@intel.com>
1 parent b377252 commit 2e171a5

File tree

2 files changed

+1
-14
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

2 files changed

+1
-14
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,10 @@ struct iwl_mvm_tt_mgmt {
539539
/**
540540
*struct iwl_mvm_thermal_device - thermal zone related data
541541
* @temp_trips: temperature thresholds for report
542-
* @fw_trips_index: keep indexes to original array - temp_trips
543542
* @tzone: thermal zone device data
544543
*/
545544
struct iwl_mvm_thermal_device {
546545
struct thermal_trip trips[IWL_MAX_DTS_TRIPS];
547-
u8 fw_trips_index[IWL_MAX_DTS_TRIPS];
548546
struct thermal_zone_device *tzone;
549547
};
550548

drivers/net/wireless/intel/iwlwifi/mvm/tt.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm)
562562
struct temp_report_ths_cmd cmd = {0};
563563
int ret;
564564
#ifdef CONFIG_THERMAL
565-
int i, j, idx = 0;
565+
int i, idx = 0;
566566

567567
lockdep_assert_held(&mvm->mutex);
568568

@@ -588,17 +588,6 @@ int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm)
588588
/*sort cmd array*/
589589
sort(cmd.thresholds, idx, sizeof(s16), compare_temps, NULL);
590590

591-
/* we should save the indexes of trips because we sort
592-
* and compress the orginal array
593-
*/
594-
for (i = 0; i < idx; i++) {
595-
for (j = 0; j < IWL_MAX_DTS_TRIPS; j++) {
596-
if ((int)(le16_to_cpu(cmd.thresholds[i]) * 1000) ==
597-
mvm->tz_device.trips[j].temperature)
598-
mvm->tz_device.fw_trips_index[i] = j;
599-
}
600-
}
601-
602591
send:
603592
#endif
604593
ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,

0 commit comments

Comments
 (0)