lkml.org 
[lkml]   [2013]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] regulator: da9063: Add missing initialization of da9063_reg_matches
Date
With gcc 4.1.2:

drivers/regulator/da9063-regulator.c: In function ‘da9063_regulator_probe’:
drivers/regulator/da9063-regulator.c:847: warning: ‘da9063_reg_matches’ is used
uninitialized in this function

If the parent device already has platform data, da9063_reg_matches will
not be initialized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Can this happen? Or will any of the b*_merged flags be set in this case, so
the while loop continues and we never get to the place where
da9063_reg_matches is used? The code is too convoluted for me to see...

drivers/regulator/da9063-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index b9f2653..3d910f4 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -717,7 +717,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
{
struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
struct da9063_pdata *da9063_pdata = dev_get_platdata(da9063->dev);
- struct of_regulator_match *da9063_reg_matches;
+ struct of_regulator_match *da9063_reg_matches = NULL;
struct da9063_regulators_pdata *regl_pdata;
const struct da9063_dev_model *model;
struct da9063_regulators *regulators;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-09-09 14:01    [W:0.262 / U:1.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site