Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: tps80031: remove redundant assignment to variables ret and val

The variables ret and val are being initialized with values that are
never read and are being updated later with a new value. The
initializations are redundant and can be removed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20200410133406.24458-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Colin Ian King and committed by
Mark Brown
2ea8db72 29ebe87c

+4 -3
+4 -3
drivers/regulator/tps80031-regulator.c
··· 271 271 { 272 272 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); 273 273 struct device *parent = to_tps80031_dev(rdev); 274 - int ret = -EIO; 274 + int ret; 275 275 uint8_t ctrl1 = 0; 276 276 uint8_t ctrl3 = 0; 277 277 ··· 322 322 { 323 323 struct tps80031_regulator *ri = rdev_get_drvdata(rdev); 324 324 struct device *parent = to_tps80031_dev(rdev); 325 - int ret = 0; 325 + int ret; 326 326 327 327 if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { 328 328 ret = tps80031_write(parent, TPS80031_SLAVE_ID2, ··· 530 530 case TPS80031_REGULATOR_LDOUSB: 531 531 if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS | 532 532 TPS80031_USBLDO_INPUT_PMID)) { 533 - unsigned val = 0; 533 + unsigned val; 534 + 534 535 if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS) 535 536 val = MISC2_LDOUSB_IN_VSYS; 536 537 else