Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317886 > unrolled thread

[PATCH] drivers: regulator: core: fix 'unused' warning

Started byYury Norov <ynorov@caviumnetworks.com>
First post2016-01-26 14:10 +0100
Last post2016-01-26 16:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers: regulator: core: fix 'unused' warning Yury Norov <ynorov@caviumnetworks.com> - 2016-01-26 14:10 +0100
    Re: [PATCH] drivers: regulator: core: fix 'unused' warning Mark Brown <broonie@kernel.org> - 2016-01-26 16:30 +0100

#1317886 — [PATCH] drivers: regulator: core: fix 'unused' warning

FromYury Norov <ynorov@caviumnetworks.com>
Date2016-01-26 14:10 +0100
Subject[PATCH] drivers: regulator: core: fix 'unused' warning
Message-ID<qVbxF-4zk-33@gated-at.bofh.it>
Patch 9f01cd4a91 (regulator: core: introduce function to lock
regulators and its supplies) introduces function
regulator_lock_supply(). On my kernel it causes compile-time
error:
drivers/regulator/core.c: In function ‘regulator_lock_supply’:
drivers/regulator/core.c:142:6: warning: unused variable ‘i’ [-Wunused-variable]
  int i = 0;

Please pull this fix.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 73b7683..2453bce 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -139,7 +139,7 @@ static bool have_full_constraints(void)
 static void regulator_lock_supply(struct regulator_dev *rdev)
 {
 	struct regulator *supply;
-	int i = 0;
+	int __maybe_unused i = 0;
 
 	while (1) {
 		mutex_lock_nested(&rdev->mutex, i++);
-- 
2.5.0

[toc] | [next] | [standalone]


#1318057

FromMark Brown <broonie@kernel.org>
Date2016-01-26 16:30 +0100
Message-ID<qVdJ9-5Zk-27@gated-at.bofh.it>
In reply to#1317886

[Multipart message — attachments visible in raw view] — view raw

On Tue, Jan 26, 2016 at 04:09:13PM +0300, Yury Norov wrote:
> Patch 9f01cd4a91 (regulator: core: introduce function to lock
> regulators and its supplies) introduces function
> regulator_lock_supply(). On my kernel it causes compile-time
> error:
> drivers/regulator/core.c: In function ‘regulator_lock_supply’:
> drivers/regulator/core.c:142:6: warning: unused variable ‘i’ [-Wunused-variable]

You're not seeing this in mainline...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web