Skip to contentSkip to conversation

thermal: intel: int340x: Drop redundant else in proc_thermal_add()

PATCH Applied Thorsten Blum 2 participants 2 messages Aug 15 – Sep 4 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: intel: int340x: Drop redundant else in proc_thermal_add()

Drop the redundant else branch since ret is immediately overwritten.

---
 .../thermal/intel/int340x_thermal/processor_thermal_device.c  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +1 -3
index f80dbe2ca7e4..0a007a6413df 100644
@@ -291,10 +291,8 @@ int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv)
 	}
 
 	proc_priv->int340x_zone = int340x_thermal_zone_add(adev, get_temp);
-	if (IS_ERR(proc_priv->int340x_zone)) {
+	if (IS_ERR(proc_priv->int340x_zone))
 		return PTR_ERR(proc_priv->int340x_zone);
-	} else
-		ret = 0;
 
 	ret = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
 					  proc_thermal_notify,
maintainer Applied
#1 lore raw
Quoted 14 lines · Thorsten Blum

Drop the redundant else branch since ret is immediately overwritten.

---
 .../thermal/intel/int340x_thermal/processor_thermal_device.c  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +0 -0
index f80dbe2ca7e4..0a007a6413df 100644
@@ -291,10 +291,8 @@ int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv)
        }

drivers/thermal/intel/int340x_thermal/processor_thermal_device.c int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv) · line 298

Quoted 10 lines
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +1 -3
 
        proc_priv->int340x_zone = int340x_thermal_zone_add(adev, get_temp);
-       if (IS_ERR(proc_priv->int340x_zone)) {
+       if (IS_ERR(proc_priv->int340x_zone))
                return PTR_ERR(proc_priv->int340x_zone);
-       } else
-               ret = 0;
 
        ret = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
                                          proc_thermal_notify,

Applied as 7.4 material, thanks!