Browse Source

eeprog: Fix ambiguous parentheses

Better separate the function call and the result test, to make the
code clearer and unambiguous.

Reported by David Binderman.
tags/v4.1
Jean Delvare 7 years ago
parent
commit
22939a7f04
  1. 1
      CHANGES
  2. 6
      eeprog/24cXX.c

1
CHANGES

@ -10,6 +10,7 @@ master
Decode physical characteristics of DDR4
Documentation update for DDR4
Verify the CRC of DDR4 data block 1
eeprog: Fix ambiguous parentheses
4.0 (2017-10-30)
tools: Fix build with recent compilers (gcc 4.6+)

6
eeprog/24cXX.c

@ -87,7 +87,8 @@ int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
return -1;
// get funcs list
if((r = ioctl(fd, I2C_FUNCS, &funcs) < 0))
r = ioctl(fd, I2C_FUNCS, &funcs);
if (r < 0)
return r;
@ -100,7 +101,8 @@ int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
CHECK_I2C_FUNC( funcs, I2C_FUNC_SMBUS_WRITE_WORD_DATA );
// set working device
if( ( r = ioctl(fd, I2C_SLAVE, addr)) < 0)
r = ioctl(fd, I2C_SLAVE, addr);
if (r < 0)
return r;
e->fd = fd;
e->addr = addr;

Loading…
Cancel
Save