Skip to contentSkip to conversation

drivers/regulator: remove redundant ret variable

PATCH In review [email protected] 2 participants 3 messages Jan 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/regulator: remove redundant ret variable

From: Minghao Chi <[email protected]>

Return value from regmap_update_bits() directly instead of taking this in another redundant variable.

---
 drivers/regulator/mt6380-regulator.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/regulator/mt6380-regulator.c +2 -4
index 9efd8710a6f3..2e6b61d3b0cf 100644
@@ -183,7 +183,7 @@ static const unsigned int ldo_volt_table4[] = {
 static int mt6380_regulator_set_mode(struct regulator_dev *rdev,
 				     unsigned int mode)
 {
-	int ret, val = 0;
+	int val = 0;
 	struct mt6380_regulator_info *info = rdev_get_drvdata(rdev);
 
 	switch (mode) {
@@ -199,10 +199,8 @@ static int mt6380_regulator_set_mode(struct regulator_dev *rdev,
 
 	val <<= ffs(info->modeset_mask) - 1;
 
-	ret = regmap_update_bits(rdev->regmap, info->modeset_reg,
+	return regmap_update_bits(rdev->regmap, info->modeset_reg,
 				 info->modeset_mask, val);
-
-	return ret;
 }
 
 static unsigned int mt6380_regulator_get_mode(struct regulator_dev *rdev)
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 4 lines · On Tue, Jan 04, 2022 at 10:41:39AM +0000, [email protected] wrote:

From: Minghao Chi <[email protected]>

Return value from regmap_update_bits() directly instead of taking this in another redundant variable.

Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.

maintainer
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, 4 Jan 2022 10:41:39 +0000, [email protected] wrote:

From: Minghao Chi <[email protected]>

Return value from regmap_update_bits() directly instead of taking this in another redundant variable.

Applied to

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

Thanks!

[1/1] drivers/regulator: remove redundant ret variable

      commit: 1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a

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