diff mbox series

[v2,1/2] spmi: get rid of a warning when built with W=1

Message ID aacfd03835b7d1b3b6c21665b44000fe7242e535.1601360391.git.mchehab+huawei@kernel.org
State Accepted
Commit b1f0aeecd25ac11053997484510a43346297a42d
Headers show
Series Some small cleanup/fixes for SPMI driver | expand

Commit Message

Mauro Carvalho Chehab Sept. 29, 2020, 6:22 a.m. UTC
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.

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/spmi/spmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Stephen Boyd Nov. 13, 2020, 8:47 p.m. UTC | #1
Quoting Mauro Carvalho Chehab (2020-09-28 23:22:12)
> 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.

> 

> Reviewed-by: Stephen Boyd <sboyd@kernel.org>

> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

> ---


Applied. Thanks!
diff mbox series

Patch

diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index c16b60f645a4..fd3ff6079b15 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -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);