aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQianfeng Rong <rongqianfeng@vivo.com>2025-08-30 17:51:05 +0800
committerGuenter Roeck <linux@roeck-us.net>2025-09-07 16:33:47 -0700
commitd5c42cb4583c59e24262f0227fe9a0bf35a661e1 (patch)
tree0636c1acb59a4276ebfe16ca4b6bec7a9f063d10
parent468a20df2ba62ab55feabc4e4306e70824bcb26c (diff)
downloadnet-d5c42cb4583c59e24262f0227fe9a0bf35a661e1.tar.gz
hwmon: (nct6775) Use int type to store negative error codes
Change the 'ret' variable from u32 to int in nct6775_asuswmi_read() to store negative error codes or zero; Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but can be confusing. Additionally, assigning negative error codes to unsigned type may trigger a GCC warning when the -Wsign-conversion flag is enabled. No effect on runtime. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Link: https://lore.kernel.org/r/20250830095105.3271-1-rongqianfeng@vivo.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/nct6775-platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/nct6775-platform.c b/drivers/hwmon/nct6775-platform.c
index 0a040364b5127e..407945d2cd6a80 100644
--- a/drivers/hwmon/nct6775-platform.c
+++ b/drivers/hwmon/nct6775-platform.c
@@ -167,7 +167,8 @@ static inline int nct6775_asuswmi_write(u8 bank, u8 reg, u8 val)
static inline int nct6775_asuswmi_read(u8 bank, u8 reg, u8 *val)
{
- u32 ret, tmp = 0;
+ u32 tmp = 0;
+ int ret;
ret = nct6775_asuswmi_evaluate_method(ASUSWMI_METHODID_RHWM, bank,
reg, 0, &tmp);