[PATCH] max1619 fix
Something horrid has happened to the indenting and braces in this function, producing a warning: drivers/hwmon/max1619.c: In function `max1619_detect': drivers/hwmon/max1619.c:196: warning: `man_id' might be used uninitialized in this function drivers/hwmon/max1619.c:196: warning: `chip_id' might be used uninitialized in this function Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b449f63c8c
commit
b0020e3f52
1 changed files with 7 additions and 9 deletions
|
@ -193,7 +193,7 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||||
int err = 0;
|
int err = 0;
|
||||||
const char *name = "";
|
const char *name = "";
|
||||||
u8 reg_config=0, reg_convrate=0, reg_status=0;
|
u8 reg_config=0, reg_convrate=0, reg_status=0;
|
||||||
u8 man_id, chip_id;
|
|
||||||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
@ -238,16 +238,15 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kind <= 0) { /* identification */
|
if (kind <= 0) { /* identification */
|
||||||
|
u8 man_id, chip_id;
|
||||||
|
|
||||||
man_id = i2c_smbus_read_byte_data(new_client,
|
man_id = i2c_smbus_read_byte_data(new_client,
|
||||||
MAX1619_REG_R_MAN_ID);
|
MAX1619_REG_R_MAN_ID);
|
||||||
chip_id = i2c_smbus_read_byte_data(new_client,
|
chip_id = i2c_smbus_read_byte_data(new_client,
|
||||||
MAX1619_REG_R_CHIP_ID);
|
MAX1619_REG_R_CHIP_ID);
|
||||||
|
|
||||||
if ((man_id == 0x4D) && (chip_id == 0x04)){
|
if ((man_id == 0x4D) && (chip_id == 0x04))
|
||||||
kind = max1619;
|
kind = max1619;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kind <= 0) { /* identification failed */
|
if (kind <= 0) { /* identification failed */
|
||||||
dev_info(&adapter->dev,
|
dev_info(&adapter->dev,
|
||||||
|
@ -255,12 +254,11 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||||
"chip_id=0x%02X).\n", man_id, chip_id);
|
"chip_id=0x%02X).\n", man_id, chip_id);
|
||||||
goto exit_free;
|
goto exit_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (kind == max1619){
|
|
||||||
name = "max1619";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (kind == max1619)
|
||||||
|
name = "max1619";
|
||||||
|
|
||||||
/* We can fill in the remaining client fields */
|
/* We can fill in the remaining client fields */
|
||||||
strlcpy(new_client->name, name, I2C_NAME_SIZE);
|
strlcpy(new_client->name, name, I2C_NAME_SIZE);
|
||||||
data->valid = 0;
|
data->valid = 0;
|
||||||
|
|
Loading…
Reference in a new issue