Skip to content

Commit 748465a

Browse files
ColinIanKinggroeck
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 1b515cf commit 748465a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/hs3001.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static u32 hs3001_extract_humidity(u16 raw)
6262
{
6363
u32 hum = (raw & HS3001_MASK_HUMIDITY_0X3FFF) * HS3001_FIXPOINT_ARITH * 100;
6464

65-
return hum /= (1 << 14) - 1;
65+
return hum / (1 << 14) - 1;
6666
}
6767

6868
static int hs3001_data_fetch_command(struct i2c_client *client,

0 commit comments

Comments
 (0)