[next] regulator: core: Remove redundant assignment to variable possible_uV

Message ID 20240216134918.2108262-1-colin.i.king@gmail.com
State New
Headers
Series [next] regulator: core: Remove redundant assignment to variable possible_uV |

Commit Message

Colin Ian King Feb. 16, 2024, 1:49 p.m. UTC
  The variable possible_uV being assigned a value that is never read, the
control flow via the following goto statement takes a path where the
variable is not accessed. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/regulator/core.c:3935:3: warning: Value stored to 'possible_uV'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/regulator/core.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Mark Brown Feb. 21, 2024, 12:51 a.m. UTC | #1
On Fri, 16 Feb 2024 13:49:18 +0000, Colin Ian King wrote:
> The variable possible_uV being assigned a value that is never read, the
> control flow via the following goto statement takes a path where the
> variable is not accessed. The assignment is redundant and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/regulator/core.c:3935:3: warning: Value stored to 'possible_uV'
> is never read [deadcode.DeadStores]
> 
> [...]

Applied to

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

Thanks!

[1/1] regulator: core: Remove redundant assignment to variable possible_uV
      commit: 055100d1a3b27ce154b3e3041d3cef24778821b3

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
  

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index a968dabb48f5..17c98c5fa45f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3932,7 +3932,6 @@  static int regulator_get_optimal_voltage(struct regulator_dev *rdev,
 		if (ret < 0)
 			return ret;
 
-		possible_uV = desired_min_uV;
 		done = true;
 
 		goto finish;