mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: helight <helight@126.com>
To: linux-kernel@vger.kernel.org
Cc: lrg@ti.com, broonie@opensource.wolfsonmicro.com
Subject: [PATCH] fix build waring: drivers/regulator/core.c: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]
Date: Fri, 9 Nov 2012 17:29:40 +0800 (CST)	[thread overview]
Message-ID: <73729ce5.abaa.13ae480da6d.Coremail.helight@126.com> (raw)

fix build waring on drivers/regulator/core.c
drivers/regulator/core.c: In function ‘regulator_get_bypass_regmap’:
drivers/regulator/core.c:2748:16: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]
drivers/regulator/core.c: In function ‘regulator_get_voltage_sel_regmap’:
drivers/regulator/core.c:2016:6: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]
drivers/regulator/core.c: In function ‘regulator_is_enabled_regmap’:
drivers/regulator/core.c:1786:14: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]


>From c5b564ba10101961ffca9a67c6ddcc6216b99dce Mon Sep 17 00:00:00 2001
From: helight xu <helight.xu@gmail.com>
Date: Sat, 10 Nov 2012 01:11:14 +0800
Subject: [PATCH] fix build waring: drivers/regulator/core.c: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]


Signed-off-by: helight xu <helight.xu@gmail.com>
---
 drivers/regulator/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5c4829c..7ad7174 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1776,8 +1776,8 @@ EXPORT_SYMBOL_GPL(regulator_disable_deferred);
  */
 int regulator_is_enabled_regmap(struct regulator_dev *rdev)
 {
-   unsigned int val;
    int ret;
+   unsigned int val = 0;

    ret = regmap_read(rdev->regmap, rdev->desc->enable_reg, &val);
    if (ret != 0)
@@ -2006,8 +2006,8 @@ EXPORT_SYMBOL_GPL(regulator_is_supported_voltage);
  */
 int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev)
 {
-   unsigned int val;
    int ret;
+   unsigned int val = 0;

    ret = regmap_read(rdev->regmap, rdev->desc->vsel_reg, &val);
    if (ret != 0)
@@ -2738,8 +2738,8 @@ EXPORT_SYMBOL_GPL(regulator_set_bypass_regmap);
  */
 int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable)
 {
-   unsigned int val;
    int ret;
+   unsigned int val = 0;

    ret = regmap_read(rdev->regmap, rdev->desc->bypass_reg, &val);
    if (ret != 0)
-- 
1.7.10.4

             reply	other threads:[~2012-11-09 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  9:29 helight [this message]
2012-11-09 11:03 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73729ce5.abaa.13ae480da6d.Coremail.helight@126.com \
    --to=helight@126.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome