[PATCH 2/2] hwmon: (adt7475) Remove some unnecessary checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The adt7475_read_word() returns u16 values, so it's impossible for
"ret" to be negative.  The check is harmless, but static checkers
complain about it.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 16045149f3db..9d3da8ea38ba 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -1492,10 +1492,7 @@ static int adt7475_update_limits(struct i2c_client *client)
 	for (i = 0; i < ADT7475_TACH_COUNT; i++) {
 		if (i == 3 && !data->has_fan4)
 			continue;
-		ret = adt7475_read_word(client, TACH_MIN_REG(i));
-		if (ret < 0)
-			return ret;
-		data->tach[MIN][i] = ret;
+		data->tach[MIN][i] = adt7475_read_word(client, TACH_MIN_REG(i));
 	}
 
 	for (i = 0; i < ADT7475_PWM_COUNT; i++) {
@@ -1881,10 +1878,7 @@ static int adt7475_update_measure(struct device *dev)
 	for (i = 0; i < ADT7475_TACH_COUNT; i++) {
 		if (i == 3 && !data->has_fan4)
 			continue;
-		ret = adt7475_read_word(client, TACH_REG(i));
-		if (ret < 0)
-			return ret;
-		data->tach[INPUT][i] = ret;
+		data->tach[INPUT][i] = adt7475_read_word(client, TACH_REG(i));
 	}
 
 	/* Updated by hw when in auto mode */



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux