]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spmi: get rid of a warning when built with W=1
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 10 Dec 2020 02:33:41 +0000 (18:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Dec 2020 09:45:35 +0000 (10:45 +0100)
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.

Link: https://lore.kernel.org/r/aacfd03835b7d1b3b6c21665b44000fe7242e535.1601360391.git.mchehab+huawei@kernel.org
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20201210023344.2838141-2-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spmi/spmi.c

index c16b60f645a4de6100a043143fb42386cbc65a7a..fd3ff6079b15de8767066da9b3fd995c25beed25 100644 (file)
@@ -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);