Skip to contentSkip to conversation

drivers/tty: delete break after return or goto

PATCH In review Bernard Zhao 2 participants 7 messages Nov 4, 2020 – Nov 5, 2020 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover drivers/tty: delete break after return or goto

This patch sereies optimise code like:
{
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):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

 drivers/tty/nozomi.c     | 4 ----
 drivers/tty/serial/imx.c | 5 -----
 2 files changed, 9 deletions(-)
Signature · 1 line
2.29.0
#1 lore raw

PATCH 1/2 drivers/tty: delete break after goto

Delete break after goto, which will never run.

---
 drivers/tty/nozomi.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/tty/nozomi.c +0 -4
index d42b854cb7df..946cc16827aa 100644
@@ -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) {
Signature · 1 line
2.29.0
#2 lore raw

PATCH 2/2 drivers/tty: delete break after return

In reply to Bernard Zhao

Delete break after return, which will never run.

---
 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.29.0
#3 lore raw
In reply to Bernard Zhao
Quoted 11 lines · Bernard Zhao

This patch sereies optimise code like:
{
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.

......
}

Quoted 6 lines

---
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

That is not the subject of the patches you sent out, what broke?

author
#4 lore raw

From: Greg Kroah-Hartman <[email protected]>
Date: 2020-11-04 19:02:53
To: Bernard Zhao <[email protected]>
Cc: Jiri Slaby <[email protected]>,Shawn Guo <[email protected]>,Sascha Hauer <[email protected]>,Pengutronix Kernel Team <[email protected]>,Fabio Estevam <[email protected]>,NXP Linux Team <[email protected]>,[email protected],[email protected],[email protected],[email protected]

Quoted 11 lines · Bernard Zhao
Quoted 11 lines

This patch sereies optimise code like:
{
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.

......
}

Quoted 8 lines
Quoted 6 lines

---
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

That is not the subject of the patches you sent out, what broke?

Hi:

I am sorry that I am a little confused:
The patch series`s subject is "drivers/tty: delete break after return or goto" and the blurb is:
This patch sereies optimise code like:
{
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.

......
}
last, the modified files are:
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

Is there something wrong that I didn`t catch?

BR//Bernard

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 40 lines · Bernard

From: Greg Kroah-Hartman <[email protected]>
Date: 2020-11-04 19:02:53
To: Bernard Zhao <[email protected]>
Cc: Jiri Slaby <[email protected]>,Shawn Guo <[email protected]>,Sascha Hauer <[email protected]>,Pengutronix Kernel Team <[email protected]>,Fabio Estevam <[email protected]>,NXP Linux Team <[email protected]>,[email protected],[email protected],[email protected],[email protected]

Quoted 11 lines · Bernard Zhao
Quoted 11 lines

This patch sereies optimise code like:
{
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.

......
}

Quoted 8 lines
Quoted 6 lines

---
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

That is not the subject of the patches you sent out, what broke?

Hi:

I am sorry that I am a little confused:
The patch series`s subject is "drivers/tty: delete break after return or goto" and the blurb is:
This patch sereies optimise code like:
{
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.
Quoted 8 lines

......
}
last, the modified files are:
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

Is there something wrong that I didn`t catch?

The above lines do not match up with the subject lines of the patches you sent out, so something went wrong.

thanks,

greg k-h

A message that is not in the archive (sent off-list or not yet received): AFMA0AACDZrecE*[email protected]

#7 lore raw
Quoted 55 lines · Bernard

From: Greg Kroah-Hartman <[email protected]>

Date: 2020-11-04 19:59:03
To: Bernard <[email protected]>
Cc: Jiri Slaby <[email protected]>,Shawn Guo <[email protected]>,Sascha Hauer <[email protected]>,Pengutronix Kernel Team <[email protected]>,Fabio Estevam <[email protected]>,NXP Linux Team <[email protected]>,[email protected],[email protected],[email protected],[email protected]

Quoted 49 lines · Bernard
Quoted 48 lines

From: Greg Kroah-Hartman <[email protected]>
Date: 2020-11-04 19:02:53
To: Bernard Zhao <[email protected]>
Cc: Jiri Slaby <[email protected]>,Shawn Guo <[email protected]>,Sascha Hauer <[email protected]>,Pengutronix Kernel Team <[email protected]>,Fabio Estevam <[email protected]>,NXP Linux Team <[email protected]>,[email protected],[email protected],[email protected],[email protected]

Quoted 11 lines · Bernard Zhao
Quoted 11 lines

This patch sereies optimise code like:
{
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.

......
}

Quoted 8 lines
Quoted 6 lines

---
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

That is not the subject of the patches you sent out, what broke?

Hi:

I am sorry that I am a little confused:
The patch series`s subject is "drivers/tty: delete break after return or goto" and the blurb is:
This patch sereies optimise code like:
{
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.

......
}
last, the modified files are:
Bernard Zhao (2):
drivers/tty/nozomi.c: delete no use break after goto drivers/tty/serial/imx.c: delete no use break after return

Is there something wrong that I didn`t catch?

Quoted 8 lines
Quoted 2 lines

The above lines do not match up with the subject lines of the patches you sent out, so something went wrong.

Hi, Greg:

Sorry to bother you.
I am a newcomer to the community, and this is my first time submitting a patch series.

You might want to start in the drivers/staging/ part of the kernel to get your bearings and work out these types of things. It's "easier" there as the code there needs lots of work and it's set up to handle new developers like yourself.

Quoted 3 lines

I am sorry that I still don't understand:"The above lines do not match up with the subject lines of the patches you sent out, so something went wrong." I compared my patch series with other people`s patch series, as shown in the picture below, they look the seem.
The only difference is that I made a signature here, so is this the issue that you mean?

the output of the git command that caused those lines to be written was taken from the subject lines of the patches in your tree. Yet the subject lines of the patches you emailed us did not match that at all, so what you sent is not what you actually had here when you generated that cover letter. So something went wrong with your process.

Try deleting all patch files in the directory and generating them again, and then emailing the series to yourself to verify that everything matches up properly.

hope this helps,

greg k-h