From: Julia Lawall Date: Tue, 16 Jun 2015 13:45:14 +0000 (-0700) Subject: regulator: fix simple_return.cocci warnings X-Git-Tag: v4.2-rc1~141^2^4~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=0f94bffad401faa045c2062f1652d21e3e89f439;p=linux.git regulator: fix simple_return.cocci warnings Simplify a trivial if-return sequence and combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Mark Brown Signed-off-by: Julia Lawall Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 162b86501a91..15bba2b4ef70 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -710,12 +710,8 @@ static int spmi_regulator_ult_lo_smps_set_voltage(struct regulator_dev *rdev, if (range_sel == 1) voltage_sel |= ULT_SMPS_RANGE_SPLIT; - ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_VOLTAGE_SET, + return spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_VOLTAGE_SET, voltage_sel, 0xff); - if (ret) - return ret; - - return 0; } static int spmi_regulator_ult_lo_smps_get_voltage(struct regulator_dev *rdev)