linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: slave: Fix missing break in switch
@ 2018-10-03 12:33 Gustavo A. R. Silva
  2018-10-03 14:46 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-03 12:33 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Gustavo A. R. Silva

Apparently, this code does not actually fall through to the next case
because the machine restarts before it has a chance. However, for the
sake of maintenance and readability, we better add the missing break
statement.

Addresses-Coverity-ID: 1437892 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/spi/spi-slave-system-control.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-slave-system-control.c b/drivers/spi/spi-slave-system-control.c
index c0257e9..169f3d5 100644
--- a/drivers/spi/spi-slave-system-control.c
+++ b/drivers/spi/spi-slave-system-control.c
@@ -60,6 +60,7 @@ static void spi_slave_system_control_complete(void *arg)
 	case CMD_REBOOT:
 		dev_info(&priv->spi->dev, "Rebooting system...\n");
 		kernel_restart(NULL);
+		break;
 
 	case CMD_POWEROFF:
 		dev_info(&priv->spi->dev, "Powering off system...\n");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-03 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-03 12:33 [PATCH] spi: slave: Fix missing break in switch Gustavo A. R. Silva
2018-10-03 14:46 ` Geert Uytterhoeven
2018-10-03 15:01   ` Mark Brown
2018-10-03 15:05     ` Gustavo A. R. Silva
2018-10-03 15:10       ` Geert Uytterhoeven
2018-10-03 18:22         ` Gustavo A. R. Silva
2018-10-03 15:24       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).