lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1441039312-2961-1-git-send-email-keith.busch@intel.com>
Date:	Mon, 31 Aug 2015 10:41:52 -0600
From:	Keith Busch <keith.busch@...el.com>
To:	linux-kernel@...r.kernel.org
Cc:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Keith Busch <keith.busch@...el.com>
Subject: [PATCH] Regulator: Suppress compiler warnings

Some compilers complain of possible uninitialized variable usage, like
the following:

  drivers/regulator/helpers.c: In function ‘regulator_get_bypass_regmap’:
  drivers/regulator/helpers.c:463:16: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]

The code is safe though, and only uses the variables if they were
successfully set, so suppressing the warning with uninitialized_val.

Signed-off-by: Keith Busch <keith.busch@...el.com>
---
 drivers/regulator/helpers.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/helpers.c b/drivers/regulator/helpers.c
index 3bbb326..bb5b22a 100644
--- a/drivers/regulator/helpers.c
+++ b/drivers/regulator/helpers.c
@@ -30,7 +30,7 @@
  */
 int regulator_is_enabled_regmap(struct regulator_dev *rdev)
 {
-	unsigned int val;
+	unsigned int uninitialized_var(val);
 	int ret;
 
 	ret = regmap_read(rdev->regmap, rdev->desc->enable_reg, &val);
@@ -114,7 +114,7 @@ EXPORT_SYMBOL_GPL(regulator_disable_regmap);
  */
 int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev)
 {
-	unsigned int val;
+	unsigned int uninitialized_var(val);
 	int ret;
 
 	ret = regmap_read(rdev->regmap, rdev->desc->vsel_reg, &val);
@@ -453,7 +453,7 @@ EXPORT_SYMBOL_GPL(regulator_set_bypass_regmap);
  */
 int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable)
 {
-	unsigned int val;
+	unsigned int uninitialized_var(val);
 	int ret;
 
 	ret = regmap_read(rdev->regmap, rdev->desc->bypass_reg, &val);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ