diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2017-10-29 00:42:10 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-10-29 00:42:10 +0200 |
commit | 9410b7d71032cc76c4211cbf8f76bad322f0c334 (patch) | |
tree | 44ab98d9e5496bd26bbd6f8fa19fee33f459c74b /drivers | |
parent | 1cf855535b034579ac4d39f49da853594ce968dc (diff) | |
download | linux-9410b7d71032cc76c4211cbf8f76bad322f0c334.tar.bz2 |
power: supply: sbs-battery: remove superfluous variable init
Those variables are immediately assigned a value afterwards.
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/supply/sbs-battery.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index 8dd4bd70c561..fb61da370947 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -177,10 +177,8 @@ static bool force_load; static int sbs_read_word_data(struct i2c_client *client, u8 address) { struct sbs_info *chip = i2c_get_clientdata(client); + int retries = chip->i2c_retry_count; s32 ret = 0; - int retries = 1; - - retries = chip->i2c_retry_count; while (retries > 0) { ret = i2c_smbus_read_word_data(client, address); @@ -204,7 +202,7 @@ static int sbs_read_string_data(struct i2c_client *client, u8 address, { struct sbs_info *chip = i2c_get_clientdata(client); s32 ret = 0, block_length = 0; - int retries_length = 1, retries_block = 1; + int retries_length, retries_block; u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1]; retries_length = chip->i2c_retry_count; @@ -269,10 +267,8 @@ static int sbs_write_word_data(struct i2c_client *client, u8 address, u16 value) { struct sbs_info *chip = i2c_get_clientdata(client); + int retries = chip->i2c_retry_count; s32 ret = 0; - int retries = 1; - - retries = chip->i2c_retry_count; while (retries > 0) { ret = i2c_smbus_write_word_data(client, address, value); |