aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2023-10-23 14:58:28 +0100
committerGuenter Roeck <linux@roeck-us.net>2023-10-28 09:21:22 -0700
commit748465a53eedbc2c440ac07f6b2328de6263dbfd (patch)
tree98f69d248af0b0631fa23bb547a17b04f344c9c6 /drivers/hwmon
parent1b515cfee17810e74cda9cf020e302747821d46c (diff)
downloadlinux-748465a53eedbc2c440ac07f6b2328de6263dbfd.tar.gz
hwmon: (hs3001) remove redundant store on division
Currently the local variable hum is being divided by a constant and the results is being re-assigned back to hum before the value is being returned to the caller. The assignment to hum is redundant and can be removed. Cleans up clang scan build warning: drivers/hwmon/hs3001.c:65:9: warning: Although the value stored to 'hum' is used in the enclosing expression, the value is never actually read from 'hum' [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20231023135828.667297-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/hs3001.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/hs3001.c b/drivers/hwmon/hs3001.c
index ac574e46d0692e..01ea9a3062bcf3 100644
--- a/drivers/hwmon/hs3001.c
+++ b/drivers/hwmon/hs3001.c
@@ -62,7 +62,7 @@ static u32 hs3001_extract_humidity(u16 raw)
{
u32 hum = (raw & HS3001_MASK_HUMIDITY_0X3FFF) * HS3001_FIXPOINT_ARITH * 100;
- return hum /= (1 << 14) - 1;
+ return hum / (1 << 14) - 1;
}
static int hs3001_data_fetch_command(struct i2c_client *client,