Skip to contentSkip to conversation

tty: remove unneeded break

PATCH Superseded [email protected] 3 participants 3 messages Oct 19, 2020 – Oct 20, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: remove unneeded break

From: Tom Rix <[email protected]>

A break is not needed if it is preceded by a return

---
 drivers/tty/serial/imx.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/tty/serial/imx.c +0 -5
index 1731d9728865..09703079db7b 100644
@@ -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);
 	}
Signature · 1 line
2.18.1
maintainer
#1 lore raw
Quoted 7 lines · On Mon, Oct 19, 2020 at 10:59:15AM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

A break is not needed if it is preceded by a return

---
 drivers/tty/serial/imx.c | 5 -----

This is the imx driver, you should say that in the subject line like you did for the other tty change you just sent out.

thanks,

greg k-h

#2 lore raw
In reply to [email protected]
Quoted 28 lines · On Mon, Oct 19, 2020 at 10:59:15AM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

A break is not needed if it is preceded by a return

---
 drivers/tty/serial/imx.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/tty/serial/imx.c +0 -2
index 1731d9728865..09703079db7b 100644
@@ -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;

drivers/tty/serial/imx.c static u32 imx_uart_readl(struct imx_port *sport, u32 offset) · line 341

Quoted 10 lines
drivers/tty/serial/imx.c +0 -3
-		break;
 	case UCR4:
 		return sport->ucr4;
-		break;
 	case UFCR:
 		return sport->ufcr;
-		break;
 	default:
 		return readl(sport->port.membase + offset);
 	}

this might be subjective, but I like the break being there for clearity. So I object to make a patch to remove them. In case I'm outvoted I'd at least want empty lines instead.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |