2020-11-07 03:42:45

by 赵军奎

[permalink] [raw]
Subject: [PATCH 2/2] drivers/tty: delete break after goto/return

Delete break after goto/return, which will never run.

Signed-off-by: Bernard Zhao <[email protected]>
---
drivers/tty/nozomi.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index d42b854cb7df..946cc16827aa 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -414,11 +414,9 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
buf16 = (u16 *) buf;
*buf16 = __le16_to_cpu(readw(ptr));
goto out;
- break;
case 4: /* 4 bytes */
*(buf) = __le32_to_cpu(readl(ptr));
goto out;
- break;
}

while (i < size_bytes) {
@@ -460,7 +458,6 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
buf16 = (const u16 *)buf;
writew(__cpu_to_le16(*buf16), ptr);
return 2;
- break;
case 1: /*
* also needs to write 4 bytes in this case
* so falling through..
@@ -468,7 +465,6 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
case 4: /* 4 bytes */
writel(__cpu_to_le32(*buf), ptr);
return 4;
- break;
}

while (i < size_bytes) {
--
2.29.0


2020-11-09 09:47:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/2] drivers/tty: delete break after goto/return

On Fri, Nov 06, 2020 at 07:29:24PM -0800, Bernard Zhao wrote:
> Delete break after goto/return, which will never run.
>
> Signed-off-by: Bernard Zhao <[email protected]>
> ---
> drivers/tty/nozomi.c | 4 ----
> 1 file changed, 4 deletions(-)

If you look at the commits for this file:

$ git log --oneline drivers/tty/nozomi.c | head -n 5
1a460c36078e tty: nozomi: remove unneeded break
caa47cc63947 tty: nozomi: Use scnprintf() for avoiding potential buffer overflow
e2c2e7987106 tty: nozomi: fix spelling mistake "reserverd" -> "reserved"
18b1345e60ae tty: nozomi: Use dev_get_drvdata
c392ed464205 tty/nozomi: use pci_iomap instead of ioremap_nocache

You will notice that you should probably put the driver name in the
subject line. Otherwise this patch really looks like you are doing this
action on all of drivers/tty/ right?

Same for patch 1/2 as was pointed out by others.

thanks,

greg k-h