[PATCH 4.9 031/128] spi: No need to assign dummy value in spi_unregister_controller()

From: Greg Kroah-Hartman
Date: Fri Jun 19 2020 - 12:45:23 EST


From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

[ Upstream commit ebc37af5e0a134355ea2b62ed4141458bdbd5389 ]

The device_for_each_child() doesn't require the returned value to be checked.
Thus, drop the dummy variable completely and have no warning anymore:

drivers/spi/spi.c: In function âspi_unregister_controllerâ:
drivers/spi/spi.c:2480:6: warning: variable âdummyâ set but not used [-Wunused-but-set-variable]
int dummy;
^~~~~

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/spi/spi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d74d341f9890..7fec76dd532f 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2025,8 +2025,6 @@ static int __unregister(struct device *dev, void *null)
*/
void spi_unregister_master(struct spi_master *master)
{
- int dummy;
-
if (master->queued) {
if (spi_destroy_queue(master))
dev_err(&master->dev, "queue remove failed\n");
@@ -2036,7 +2034,7 @@ void spi_unregister_master(struct spi_master *master)
list_del(&master->list);
mutex_unlock(&board_lock);

- dummy = device_for_each_child(&master->dev, NULL, __unregister);
+ device_for_each_child(&master->dev, NULL, __unregister);
device_unregister(&master->dev);
}
EXPORT_SYMBOL_GPL(spi_unregister_master);
--
2.25.1