Re: [PATCH v5 3/4] iio: chemical: Add Senseair Sunrise 006-0-007 driver

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

 



On Thu, Sep 09, 2021 at 04:01:48PM +0300, Andy Shevchenko wrote:
> On Thu, Sep 09, 2021 at 11:45:36AM +0200, Jacopo Mondi wrote:

> > +	struct i2c_client *client = context;
> > +	union i2c_smbus_data data;
> > +
> > +	/* Discard reg address from values count. */
> > +	if (count < 1)
> > +		return -EINVAL;
> > +	count--;
> 
> Wouldn't be more natural to decrement and then check against 0?

Ah, count is of size_t. Then comparison < 1 is equal to !count.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux