2023-01-30 18:48:11

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH v2 3/4] thermal: intel: int340x: Drop pointless cast to unsigned long

From: Rafael J. Wysocki <[email protected]>

The explicit casting from int to unsigned long in
int340x_thermal_get_zone_temp() is pointless, becuase the multiplication
result is cast back to int by the assignment in the same statement, so
drop it.

No expected functional impact.

Signed-off-by: Rafael J. Wysocki <[email protected]>
---

v1 -> v2:
* It was [6/6] in v1
* Rebase

---
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
===================================================================
--- linux-pm.orig/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -29,7 +29,7 @@ static int int340x_thermal_get_zone_temp
if (conv_temp < 0)
return conv_temp;

- *temp = (unsigned long)conv_temp * 10;
+ *temp = conv_temp * 10;
} else {
/* _TMP returns the temperature in tenths of degrees Kelvin */
*temp = deci_kelvin_to_millicelsius(tmp);





2023-01-31 15:38:52

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] thermal: intel: int340x: Drop pointless cast to unsigned long

On 30/01/2023 19:45, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <[email protected]>
>
> The explicit casting from int to unsigned long in
> int340x_thermal_get_zone_temp() is pointless, becuase the multiplication
> result is cast back to int by the assignment in the same statement, so
> drop it.
>
> No expected functional impact.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---

Acked-by: Daniel Lezcano <[email protected]>

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog