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

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

 



Hi Dan-san,

Thank you so much for this fix also.

Reviewed-by: Tokunori Ikegami <ikegami@xxxxxxxxxxxxxxxxxxxx>

By the way I will do try to change the adt7475_read_word() to return the error correctly in near future.

Regards,
Ikegami

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Tuesday, August 14, 2018 6:15 PM
> To: Jean Delvare; IKEGAMI Tokunori
> Cc: Guenter Roeck; linux-hwmon@xxxxxxxxxxxxxxx;
> kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [PATCH 2/2] hwmon: (adt7475) Remove some unnecessary checks
> 
> 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