mbox series

[0/2] drivers/tty: delete break after return or goto

Message ID 20201107032924.25044-1-bernard@vivo.com
Headers show
Series drivers/tty: delete break after return or goto | expand

Message

Bernard Zhao Nov. 7, 2020, 3:29 a.m. UTC
Hi, Greg:

This patch sereies delete code which never run:
{
case XXX:
	return XXX;
	break; //The break is meanless, so just delete it.
case YYY:
	goto YYY;
	break; //The break is meanless, so just delete it.
......
}

Bernard Zhao (2):
  tty/serial: delete break after return
  drivers/tty: delete break after goto/return

 drivers/tty/nozomi.c     | 4 ----
 drivers/tty/serial/imx.c | 5 -----
 2 files changed, 9 deletions(-)

Comments

Greg Kroah-Hartman Nov. 9, 2020, 9:45 a.m. UTC | #1
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 <bernard@vivo.com>
> ---
>  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