regmap: silence GCC warning
authorPaul Bolle <pebolle@tiscali.nl>
Mon, 8 Oct 2012 20:06:30 +0000 (22:06 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 15 Oct 2012 01:03:19 +0000 (10:03 +0900)
Building regmap.o triggers this GCC warning:
    drivers/base/regmap/regmap.c: In function ‘regmap_raw_read’:
    drivers/base/regmap/regmap.c:1172:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Long story short: Jakub Jelinek pointed out that there is a type
mismatch between 'num' in regmap_volatile_range() and 'val_count' in
regmap_raw_read(). And indeed, converting 'num' to the type of
'val_count' (ie, size_t) makes this warning go away.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap.c

index 52069d29ff12ef197c7d8a447ab27ffb7096d85e..94555951b6e13aa57be595c8a657c4a2ad25b93b 100644 (file)
@@ -82,7 +82,7 @@ bool regmap_precious(struct regmap *map, unsigned int reg)
 }
 
 static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
-       unsigned int num)
+       size_t num)
 {
        unsigned int i;