tty: serdev: core: Remove unused variable 'dummy'
authorLee Jones <lee.jones@linaro.org>
Wed, 4 Nov 2020 19:35:14 +0000 (19:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2020 09:49:26 +0000 (10:49 +0100)
No need to have a dummy variable here.

Fixes the following W=1 kernel build warning(s):

 drivers/tty/serdev/core.c: In function ‘serdev_controller_remove’:
 drivers/tty/serdev/core.c:791:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]

Cc: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20201104193549.4026187-2-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serdev/core.c

index c5f0d93..fecc28a 100644 (file)
@@ -788,13 +788,10 @@ static int serdev_remove_device(struct device *dev, void *data)
  */
 void serdev_controller_remove(struct serdev_controller *ctrl)
 {
-       int dummy;
-
        if (!ctrl)
                return;
 
-       dummy = device_for_each_child(&ctrl->dev, NULL,
-                                     serdev_remove_device);
+       device_for_each_child(&ctrl->dev, NULL, serdev_remove_device);
        pm_runtime_disable(&ctrl->dev);
        device_del(&ctrl->dev);
 }