Skip to contentSkip to conversation

regmap: debugfs: Fix compiler warning

PATCH In review Stratos Karafotis 2 participants 2 messages Feb 2, 2013 – Feb 4, 2013

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

PATCH 1/1 regmap: debugfs: Fix compiler warning

This patch fixes the following compiler warning of uninitialized variable:

drivers/base/regmap/regmap-debugfs.c: In function ‘regmap_read_debugfs’:
drivers/base/regmap/regmap-debugfs.c:180:9: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

---
 drivers/base/regmap/regmap-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap-debugfs.c +1 -1
index d9a6c94..aa570af 100644
@@ -80,7 +80,7 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
 {
        struct regmap_debugfs_off_cache *c = NULL;
        loff_t p = 0;
-       unsigned int i, ret;
+       unsigned int i, ret = base;
 
        /*
         * If we don't have a cache build one so we don't have to do a
Signature · 1 line
1.8.1
#1 lore raw
Quoted 6 lines · Stratos Karafotis

This patch fixes the following compiler warning of uninitialized variable:

drivers/base/regmap/regmap-debugfs.c: In function ‘regmap_read_debugfs’:
drivers/base/regmap/regmap-debugfs.c:180:9: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

This isn't present in current code.