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

regulator: cpcap-regulator: Remove declared and set, but never used variable 'ignore'

It's okay to not check the return value that you're not conserned
about, however it is not okay to assign a variable and not check or
use the result.

Fixes W=1 warnings(s):

drivers/regulator/cpcap-regulator.c:172:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable]
172 | int error, ignore;
| ^~~~~~
drivers/regulator/cpcap-regulator.c: In function ‘cpcap_regulator_disable’:
drivers/regulator/cpcap-regulator.c:196:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable]
196 | int error, ignore;
| ^~~~~~

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200625163614.4001403-8-lee.jones@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Lee Jones and committed by
Mark Brown
b89a5eff 2f5add1e

+6 -6
+6 -6
drivers/regulator/cpcap-regulator.c
··· 169 169 static int cpcap_regulator_enable(struct regulator_dev *rdev) 170 170 { 171 171 struct cpcap_regulator *regulator = rdev_get_drvdata(rdev); 172 - int error, ignore; 172 + int error; 173 173 174 174 error = regulator_enable_regmap(rdev); 175 175 if (error) ··· 180 180 regulator->assign_mask, 181 181 regulator->assign_mask); 182 182 if (error) 183 - ignore = regulator_disable_regmap(rdev); 183 + regulator_disable_regmap(rdev); 184 184 } 185 185 186 186 return error; ··· 193 193 static int cpcap_regulator_disable(struct regulator_dev *rdev) 194 194 { 195 195 struct cpcap_regulator *regulator = rdev_get_drvdata(rdev); 196 - int error, ignore; 196 + int error; 197 197 198 198 if (rdev->desc->enable_val & CPCAP_REG_OFF_MODE_SEC) { 199 199 error = regmap_update_bits(rdev->regmap, regulator->assign_reg, ··· 204 204 205 205 error = regulator_disable_regmap(rdev); 206 206 if (error && (rdev->desc->enable_val & CPCAP_REG_OFF_MODE_SEC)) { 207 - ignore = regmap_update_bits(rdev->regmap, regulator->assign_reg, 208 - regulator->assign_mask, 209 - regulator->assign_mask); 207 + regmap_update_bits(rdev->regmap, regulator->assign_reg, 208 + regulator->assign_mask, 209 + regulator->assign_mask); 210 210 } 211 211 212 212 return error;