Skip to contentSkip to conversation

thermal: intel: intel_soc_dts_iosf: Remove redundant check

PATCH Applied Zhang Rui 2 participants 2 messages Aug 13, 2023 – Aug 22, 2023 Thermal

lore
Share & tools
lore

Zhang Rui

author reviewer
#0 lore raw

PATCH v2 1/1 thermal: intel: intel_soc_dts_iosf: Remove redundant check

Remove the redundant check in remove_dts_thermal_zone() because all of its existing callers pass a valid pointer as the argument.

---
 drivers/thermal/intel/intel_soc_dts_iosf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/thermal/intel/intel_soc_dts_iosf.c +3 -5
index db97499f4f0a..22fc2970c67d 100644
@@ -245,11 +245,9 @@ static int soc_dts_enable(int id)
 
 static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts)
 {
-	if (dts) {
-		iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
-			       SOC_DTS_OFFSET_ENABLE, dts->store_status);
-		thermal_zone_device_unregister(dts->tzone);
-	}
+	iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
+		       SOC_DTS_OFFSET_ENABLE, dts->store_status);
+	thermal_zone_device_unregister(dts->tzone);
 }
 
 static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts,
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 19 lines · Zhang Rui

Remove the redundant check in remove_dts_thermal_zone() because all of its existing callers pass a valid pointer as the argument.

---
 drivers/thermal/intel/intel_soc_dts_iosf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/thermal/intel/intel_soc_dts_iosf.c +0 -2
index db97499f4f0a..22fc2970c67d 100644
@@ -245,11 +245,9 @@ static int soc_dts_enable(int id)
 
 static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts)
 {
-       if (dts) {
-               iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,

drivers/thermal/intel/intel_soc_dts_iosf.c static int soc_dts_enable(int id)

Quoted 10 lines
drivers/thermal/intel/intel_soc_dts_iosf.c +3 -4
-                              SOC_DTS_OFFSET_ENABLE, dts->store_status);
-               thermal_zone_device_unregister(dts->tzone);
-       }
+       iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
+                      SOC_DTS_OFFSET_ENABLE, dts->store_status);
+       thermal_zone_device_unregister(dts->tzone);
 }
 
 static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts,
--

Applied as 6.6 material, thanks!