* [PATCH -next] tty: serial: imx: remove unnecessary breaks
@ 2020-10-26 12:51 ` Zhang Qilong
0 siblings, 0 replies; 6+ messages in thread
From: Zhang Qilong @ 2020-10-26 12:51 UTC (permalink / raw)
To: gregkh, shawnguo, s.hauer
Cc: kernel, festevam, linux-imx, linux-serial, linux-arm-kernel
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(-)
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);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] tty: serial: imx: remove unnecessary breaks
@ 2020-10-26 12:51 ` Zhang Qilong
0 siblings, 0 replies; 6+ messages in thread
From: Zhang Qilong @ 2020-10-26 12:51 UTC (permalink / raw)
To: gregkh, shawnguo, s.hauer
Cc: linux-arm-kernel, festevam, linux-imx, kernel, linux-serial
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(-)
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);
}
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] tty: serial: imx: remove unnecessary breaks
2020-10-26 12:51 ` Zhang Qilong
@ 2020-10-26 16:34 ` Uwe Kleine-König
-1 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2020-10-26 16:34 UTC (permalink / raw)
To: Zhang Qilong
Cc: gregkh, shawnguo, s.hauer, linux-arm-kernel, festevam, linux-imx,
kernel, linux-serial
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
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
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] tty: serial: imx: remove unnecessary breaks
@ 2020-10-26 16:34 ` Uwe Kleine-König
0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2020-10-26 16:34 UTC (permalink / raw)
To: Zhang Qilong
Cc: linux-serial, gregkh, s.hauer, linux-imx, kernel, shawnguo,
festevam, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 885 bytes --]
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
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* 答复: [PATCH -next] tty: serial: imx: remove unnecessary breaks
2020-10-26 16:34 ` Uwe Kleine-König
@ 2020-10-27 8:54 ` zhangqilong
-1 siblings, 0 replies; 6+ messages in thread
From: zhangqilong @ 2020-10-27 8:54 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: gregkh, shawnguo, s.hauer, linux-arm-kernel, festevam, linux-imx,
kernel, linux-serial
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
I have seen that patch, thank you for nice reminding. It's not a tool tip. I find it
when reading that code. So sending the patch to optimize it. It also looks good
to keep 'break'.
Thanks, best wish to you!
Zhang Qilong
>
> [1] https://lore.kernel.org/r/20201019175915.3718-1-trix@redhat.com
> --
> Pengutronix e.K. | Uwe Kleine-König
> |
> Industrial Linux Solutions | https://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 6+ messages in thread
* 答复: [PATCH -next] tty: serial: imx: remove unnecessary breaks
@ 2020-10-27 8:54 ` zhangqilong
0 siblings, 0 replies; 6+ messages in thread
From: zhangqilong @ 2020-10-27 8:54 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-serial, gregkh, s.hauer, linux-imx, kernel, shawnguo,
festevam, linux-arm-kernel
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
I have seen that patch, thank you for nice reminding. It's not a tool tip. I find it
when reading that code. So sending the patch to optimize it. It also looks good
to keep 'break'.
Thanks, best wish to you!
Zhang Qilong
>
> [1] https://lore.kernel.org/r/20201019175915.3718-1-trix@redhat.com
> --
> Pengutronix e.K. | Uwe Kleine-König
> |
> Industrial Linux Solutions | https://www.pengutronix.de/ |
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-10-27 8:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 12:51 [PATCH -next] tty: serial: imx: remove unnecessary breaks Zhang Qilong
2020-10-26 12:51 ` Zhang Qilong
2020-10-26 16:34 ` Uwe Kleine-König
2020-10-26 16:34 ` Uwe Kleine-König
2020-10-27 8:54 ` 答复: " zhangqilong
2020-10-27 8:54 ` zhangqilong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.