regmap: Add missing initialization of this_page
Subsystems (2)
PATCH 1/1 regmap: Add missing initialization of this_page
drivers/base/regmap/regmap.c: In function ‘_regmap_range_multi_paged_reg_write’:drivers/base/regmap/regmap.c:1665: warning: ‘this_page’ may be used uninitialized in this function
---
This may be a false positive, if "range" is guaranteed to be non-zero during the first iteration of the loop
--- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
@@ -1662,7 +1662,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,int ret;int i, n;struct reg_default *base; -unsigned int this_page; +unsigned int this_page =0 ;/* * the set of registers are not neccessarily in order, but * since the order of write must be preserved this algorithm
Signature · 1 line
1.7.9.5
Mark Brown
maintainerQuoted 7 lines · Geert Uytterhoeven
drivers/base/regmap/regmap.c: In function ‘_regmap_range_multi_paged_reg_write’:drivers/base/regmap/regmap.c:1665: warning: ‘this_page’ may be used uninitialized in this functionSigned-off-by Geert Uytterhoeven <[email protected]>---
This may be a false positive, if "range" is guaranteed to be non-zero during the first iteration of the loop
Applied, though with this sort of thing it's generally a bit better to do the init at the start of the loop rather than at declaration - init at declaration is a common pattern for just shutting up warnings as opposed to analyisng to make sure that there's really not an issue.