Re: [patch] hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0

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

 



On 08/14/2013 03:53 AM, Dan Carpenter wrote:
On Wed, Aug 14, 2013 at 12:45:26PM +0300, Dan Carpenter wrote:
The callers never check for negative but they sometimes check for zero
returns:

	int reg = ADT7462_REG_VOLT_MAX(data, i);
         data->volt_max[i] =
		(reg ? i2c_smbus_read_byte_data(client, reg) : 0);

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
Static checker stuff.  I don't have this hardware.

I should have also said that not all the callers check for error.
I don't know if that is a problem.


It is undesirable, but would be much more complex to fix.
So your patch is the sensible approach to take care of the
immediate problem, and we can leave the fancy solution to
someone with enough time at hand.

I'll apply it to -next.

Thanks,
Guenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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