Skip to contentSkip to conversation

spmi: get rid of a warning when built with W=1

PATCH Applied Mauro Carvalho Chehab 3 participants 3 messages Aug 12, 2020 – Dec 29, 2020

Subsystems (2)

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spmi: get rid of a warning when built with W=1

The SPMI core complaing with this warning when built with W=1:

	drivers/spmi/spmi.c: In function ‘spmi_controller_remove’:
	drivers/spmi/spmi.c:548:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
	  548 |  int dummy;
	      |      ^~~~~

As the dummy var isn't needed, remove it.

---
 drivers/spmi/spmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spmi/spmi.c +1 -4
index c16b60f645a4..fd3ff6079b15 100644
@@ -545,13 +545,10 @@ static int spmi_ctrl_remove_device(struct device *dev, void *data)
  */
 void spmi_controller_remove(struct spmi_controller *ctrl)
 {
-	int dummy;
-
 	if (!ctrl)
 		return;
 
-	dummy = device_for_each_child(&ctrl->dev, NULL,
-				      spmi_ctrl_remove_device);
+	device_for_each_child(&ctrl->dev, NULL, spmi_ctrl_remove_device);
 	device_del(&ctrl->dev);
 }
 EXPORT_SYMBOL_GPL(spmi_controller_remove);
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw

Quoting Mauro Carvalho Chehab (2020-08-12 05:29:18)

Quoted 11 lines

The SPMI core complaing with this warning when built with W=1:

drivers/spmi/spmi.c: In function ‘spmi_controller_remove’:
drivers/spmi/spmi.c:548:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
548 | int dummy;
| ^~~~~

As the dummy var isn't needed, remove it.

---

#2 lore raw
In reply to Mauro Carvalho Chehab
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 8 lines · On Wed, 12 Aug 2020 14:29:18 +0200 you wrote:

The SPMI core complaing with this warning when built with W=1:

	drivers/spmi/spmi.c: In function ‘spmi_controller_remove’:
	drivers/spmi/spmi.c:548:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
	  548 |  int dummy;
	      |      ^~~~~

[...]

Here is the summary with links:
- spmi: get rid of a warning when built with W=1

    https://git.kernel.org/qcom/c/b1f0aeecd25a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html