Skip to contentSkip to conversation

hwmon: (nct6775) Drop unneeded casting and conjunction

PATCH Applied Andy Shevchenko 2 participants 2 messages Feb 17, 2023 – Feb 25, 2023 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (nct6775) Drop unneeded casting and conjunction

The 64-bit result will be cut to 32-bit automatically (by compiler) due to the type of the destination value. No need to have an explicit casting and especially additional conjunction which does the same.

---
 drivers/hwmon/nct6775-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/nct6775-platform.c +1 -1
index 76c6b564d7fc..7576b8ffec67 100644
@@ -149,7 +149,7 @@ static int nct6775_asuswmi_evaluate_method(u32 method_id, u8 bank, u8 reg, u8 va
 		return -EIO;
 
 	if (retval)
-		*retval = (u32)result & 0xFFFFFFFF;
+		*retval = result;
 
 	return 0;
 #else
Signature · 1 line
2.39.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Andy Shevchenko

The 64-bit result will be cut to 32-bit automatically (by compiler) due to the type of the destination value. No need to have an explicit casting and especially additional conjunction which does the same.

Applied to hwmon-next.

Thanks,
Guenter