2022-08-24 07:57:03

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] regulator: max597x: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value from regmap_write() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
---
drivers/regulator/max597x-regulator.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/max597x-regulator.c b/drivers/regulator/max597x-regulator.c
index 03c6027682d8..39f803ff0a90 100644
--- a/drivers/regulator/max597x-regulator.c
+++ b/drivers/regulator/max597x-regulator.c
@@ -137,7 +137,7 @@ static int max597x_set_ovp(struct regulator_dev *rdev, int lim_uV, int severity,
static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
int severity, bool enable)
{
- int ret, val, reg;
+ int val, reg;
unsigned int vthst, vthfst;

struct max597x_regulator *data = rdev_get_drvdata(rdev);
@@ -183,9 +183,8 @@ static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
val = 0xFF;

reg = MAX5970_REG_DAC_FAST(rdev_id);
- ret = regmap_write(rdev->regmap, reg, val);

- return ret;
+ return regmap_write(rdev->regmap, reg, val);
}

static int max597x_get_status(struct regulator_dev *rdev)
--
2.25.1


2022-08-24 13:26:16

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH linux-next] regulator: max597x: Remove the unneeded result variable

On Wed, 24 Aug 2022 07:47:07 +0000, [email protected] wrote:
> From: ye xingchen <[email protected]>
>
> Return the value from regmap_write() directly instead of storing it
> in another redundant variable.
>
>

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: max597x: Remove the unneeded result variable
commit: 48aa47308de609e687dc187b72de92e3346c4187

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark