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