[PATCH] regulator: Remove unnecessary memset

Liao Yuanhong posted 1 patch 1 month, 4 weeks ago
drivers/regulator/tps6524x-regulator.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] regulator: Remove unnecessary memset
Posted by Liao Yuanhong 1 month, 4 weeks ago
devm_kzalloc() has already been initialized to full 0 space, there is no
need to use memset() to initialize again.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/regulator/tps6524x-regulator.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c
index 3fee7e38c68b..6beb51293e8e 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -598,7 +598,6 @@ static int pmic_probe(struct spi_device *spi)
 
 	spi_set_drvdata(spi, hw);
 
-	memset(hw, 0, sizeof(struct tps6524x));
 	hw->dev = dev;
 	hw->spi = spi;
 	mutex_init(&hw->lock);
-- 
2.34.1
Re: [PATCH] regulator: Remove unnecessary memset
Posted by Mark Brown 1 month, 3 weeks ago
On Thu, 07 Aug 2025 20:39:49 +0800, Liao Yuanhong wrote:
> devm_kzalloc() has already been initialized to full 0 space, there is no
> need to use memset() to initialize again.
> 
> 

Applied to

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

Thanks!

[1/1] regulator: Remove unnecessary memset
      commit: f6cc4140e161831e5796f099f5abc3af953ae2b8

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