diff mbox series

[v1,1/1] hwmon: (nct6775) Drop unneeded casting and conjunction

Message ID 20230217191600.24837-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series [v1,1/1] hwmon: (nct6775) Drop unneeded casting and conjunction | expand

Commit Message

Andy Shevchenko Feb. 17, 2023, 7:16 p.m. UTC
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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/nct6775-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Feb. 25, 2023, 3:09 p.m. UTC | #1
On Fri, Feb 17, 2023 at 09:16:00PM +0200, Andy Shevchenko wrote:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to hwmon-next.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index 76c6b564d7fc..7576b8ffec67 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -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