Re: i2c-tools bug report

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

 



Hi David,

> eeprog/24cXX.c:90]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
> 
> Source code is
> 
> 
>        if((r = ioctl(fd, I2C_FUNCS, &funcs) < 0))
>                 return r;
> 
> Maybe better code
> 
> 
>        if((r = ioctl(fd, I2C_FUNCS, &funcs)) < 0)
>                 return r;

Thanks for the report. Even better is to separate the function call and
the result test, so we don't need the extra pair of parentheses. I have
just committed such a fix:

https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/commit/?id=22939a7f040fc3a425da55d9d39b8d172cdf9afe

-- 
Jean Delvare
SUSE L3 Support



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux