2024-03-29 15:15:16

by Richard Fitzgerald

[permalink] [raw]
Subject: [PATCH] regmap: maple: Fix uninitialized symbol 'ret' warnings

Fix warnings reported by smatch by initializing local 'ret' variable
to 0.

drivers/base/regmap/regcache-maple.c:186 regcache_maple_drop()
error: uninitialized symbol 'ret'.
drivers/base/regmap/regcache-maple.c:290 regcache_maple_sync()
error: uninitialized symbol 'ret'.

Signed-off-by: Richard Fitzgerald <[email protected]>
Fixes: f033c26de5a5 ("regmap: Add maple tree based register cache")
---
Hope to send a KUnit test update for this and my cache-corruption fix
sometime next week.
---
drivers/base/regmap/regcache-maple.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 0243fa485af5..e42433404854 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -112,7 +112,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
unsigned long *entry, *lower, *upper;
unsigned long lower_index, lower_last;
unsigned long upper_index, upper_last;
- int ret;
+ int ret = 0;

lower = NULL;
upper = NULL;
@@ -244,7 +244,7 @@ static int regcache_maple_sync(struct regmap *map, unsigned int min,
unsigned long lmin = min;
unsigned long lmax = max;
unsigned int r, v, sync_start;
- int ret;
+ int ret = 0;
bool sync_needed = false;

map->cache_bypass = true;
--
2.39.2



2024-03-29 18:38:48

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: maple: Fix uninitialized symbol 'ret' warnings

On Fri, 29 Mar 2024 14:46:30 +0000, Richard Fitzgerald wrote:
> Fix warnings reported by smatch by initializing local 'ret' variable
> to 0.
>
> drivers/base/regmap/regcache-maple.c:186 regcache_maple_drop()
> error: uninitialized symbol 'ret'.
> drivers/base/regmap/regcache-maple.c:290 regcache_maple_sync()
> error: uninitialized symbol 'ret'.
>
> [...]

Applied to

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

Thanks!

[1/1] regmap: maple: Fix uninitialized symbol 'ret' warnings
commit: eaa03486d932572dfd1c5f64f9dfebe572ad88c0

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