diff mbox series

[-next] tty: serial: imx: remove unnecessary breaks

Message ID 20201026125142.21105-1-zhangqilong3@huawei.com
State New
Headers show
Series [-next] tty: serial: imx: remove unnecessary breaks | expand

Commit Message

Zhang Qilong Oct. 26, 2020, 12:51 p.m. UTC
The 'break' is not possoble to be reached
because of previous 'return', discard it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/tty/serial/imx.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Uwe Kleine-König Oct. 26, 2020, 4:34 p.m. UTC | #1
hello,

On Mon, Oct 26, 2020 at 08:51:42PM +0800, Zhang Qilong wrote:
> The 'break' is not possoble to be reached
s/possoble/possible/

> because of previous 'return', discard it.

Given that this such a patch was already sent a week ago[1], I wonder if
there is a tool that complains here? If so, mentioning it in the commit
log would be good.

Other than that I still think that there should be at least an empty
line instead of the break, as I already wrote in reply to the first
patch. And having said that I also don't think this is worth "fixing",
seeing the break in a switch statement is good for human readers.

Best regards
Uwe

[1] https://lore.kernel.org/r/20201019175915.3718-1-trix@redhat.com
diff mbox series

Patch

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 1731d9728865..09703079db7b 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -320,7 +320,6 @@  static u32 imx_uart_readl(struct imx_port *sport, u32 offset)
 	switch (offset) {
 	case UCR1:
 		return sport->ucr1;
-		break;
 	case UCR2:
 		/*
 		 * UCR2_SRST is the only bit in the cached registers that might
@@ -331,16 +330,12 @@  static u32 imx_uart_readl(struct imx_port *sport, u32 offset)
 		if (!(sport->ucr2 & UCR2_SRST))
 			sport->ucr2 = readl(sport->port.membase + offset);
 		return sport->ucr2;
-		break;
 	case UCR3:
 		return sport->ucr3;
-		break;
 	case UCR4:
 		return sport->ucr4;
-		break;
 	case UFCR:
 		return sport->ufcr;
-		break;
 	default:
 		return readl(sport->port.membase + offset);
 	}