Changeset 4094

Show
Ignore:
Timestamp:
08/12/06 23:02:54 (8 years ago)
Author:
khali
Message:

Rewrite the bank switching code in a slightly different way to keep
some compilers quiet.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/dump/i2cdump.c

    r4080 r4094  
    291291        /* See Winbond w83781d data sheet for bank details */ 
    292292        if (bank && size != I2C_SMBUS_BLOCK_DATA) { 
    293                 old_bank = i2c_smbus_read_byte_data(file, bankreg); 
    294                 if (old_bank >= 0) 
     293                res = i2c_smbus_read_byte_data(file, bankreg); 
     294                if (res >= 0) { 
     295                        old_bank = res; 
    295296                        res = i2c_smbus_write_byte_data(file, bankreg, 
    296297                                bank | (old_bank & 0xf0)); 
    297                 if (old_bank < 0 || res < 0) { 
     298                } 
     299                if (res < 0) { 
    298300                        fprintf(stderr, "Error: Bank switching failed\n"); 
    299301                        exit(1);