linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing
@ 2020-12-06  7:39 Clement Smith
  2020-12-06  7:39 ` [PATCH 2/8] " Clement Smith
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 689774c073ca..512b77195e9f 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -607,7 +607,7 @@ void jsm_input(struct jsm_channel *ch)
 				 * Give the Linux ld the flags in the
 				 * format it likes.
 				 */
-				if (*(ch->ch_equeue +tail +i) & UART_LSR_BI)
+				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
 				else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 3/8] " Clement Smith
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 512b77195e9f..202d6ba93313 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -608,7 +608,7 @@ void jsm_input(struct jsm_channel *ch)
 				 * format it likes.
 				 */
 				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
+					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i),  TTY_BREAK);
 				else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
 				else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
  2020-12-06  7:39 ` [PATCH 2/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 4/8] " Clement Smith
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 202d6ba93313..2bc5f32e59f4 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -609,7 +609,7 @@ void jsm_input(struct jsm_channel *ch)
 				 */
 				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i),  TTY_BREAK);
-				else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
+				else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
 				else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
  2020-12-06  7:39 ` [PATCH 2/8] " Clement Smith
  2020-12-06  7:39 ` [PATCH 3/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 5/8] " Clement Smith
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 2bc5f32e59f4..45e212be64c4 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -610,7 +610,7 @@ void jsm_input(struct jsm_channel *ch)
 				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i),  TTY_BREAK);
 				else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
+					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
 				else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
 				else
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (2 preceding siblings ...)
  2020-12-06  7:39 ` [PATCH 4/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 6/8] " Clement Smith
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 45e212be64c4..75c9bfa5077c 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -611,7 +611,7 @@ void jsm_input(struct jsm_channel *ch)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i),  TTY_BREAK);
 				else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
-				else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
+				else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
 				else
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (3 preceding siblings ...)
  2020-12-06  7:39 ` [PATCH 5/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 7/8] " Clement Smith
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 75c9bfa5077c..19d2f0bc6c10 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -612,7 +612,7 @@ void jsm_input(struct jsm_channel *ch)
 				else if (*(ch->ch_equeue + tail + i) & UART_LSR_PE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_PARITY);
 				else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
+					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_FRAME);
 				else
 					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
 			}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (4 preceding siblings ...)
  2020-12-06  7:39 ` [PATCH 6/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  7:39 ` [PATCH 8/8] tty: serial: jsm: Removed assignment in if statement Clement Smith
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 19d2f0bc6c10..eab82fb6b384 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -614,7 +614,7 @@ void jsm_input(struct jsm_channel *ch)
 				else if (*(ch->ch_equeue + tail + i) & UART_LSR_FE)
 					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_FRAME);
 				else
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
+					tty_insert_flip_char(port, *(ch->ch_rqueue + tail + i), TTY_NORMAL);
 			}
 		} else {
 			tty_insert_flip_string(port, ch->ch_rqueue + tail, s);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] tty: serial: jsm: Removed assignment in if statement
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (5 preceding siblings ...)
  2020-12-06  7:39 ` [PATCH 7/8] " Clement Smith
@ 2020-12-06  7:39 ` Clement Smith
  2020-12-06  8:08 ` [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Greg KH
  2020-12-06 11:04 ` Joe Perches
  8 siblings, 0 replies; 10+ messages in thread
From: Clement Smith @ 2020-12-06  7:39 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Clement Smith

Fixed a coding style issue

Signed-off-by: Clement Smith <rclemsmith@gmail.com>
---
 drivers/tty/serial/jsm/jsm_tty.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index eab82fb6b384..bfd4b55e6c74 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -742,7 +742,8 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
 	int qleft;
 
 	/* Store how much space we have left in the queue */
-	if ((qleft = ch->ch_r_tail - ch->ch_r_head - 1) < 0)
+    qleft = ch->ch_r_tail - ch->ch_r_head - 1;
+	if (qleft < 0)
 		qleft += RQUEUEMASK + 1;
 
 	/*
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (6 preceding siblings ...)
  2020-12-06  7:39 ` [PATCH 8/8] tty: serial: jsm: Removed assignment in if statement Clement Smith
@ 2020-12-06  8:08 ` Greg KH
  2020-12-06 11:04 ` Joe Perches
  8 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2020-12-06  8:08 UTC (permalink / raw)
  To: Clement Smith; +Cc: linux-serial, linux-kernel

On Sun, Dec 06, 2020 at 01:09:25PM +0530, Clement Smith wrote:
> Fixed a coding style issue
> 
> Signed-off-by: Clement Smith <rclemsmith@gmail.com>
> ---
>  drivers/tty/serial/jsm/jsm_tty.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I see you ignored my suggestion and so, sadly, I will just ignore this
patchset :(

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing
  2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
                   ` (7 preceding siblings ...)
  2020-12-06  8:08 ` [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Greg KH
@ 2020-12-06 11:04 ` Joe Perches
  8 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2020-12-06 11:04 UTC (permalink / raw)
  To: Clement Smith, gregkh; +Cc: linux-serial, linux-kernel

On Sun, 2020-12-06 at 13:09 +0530, Clement Smith wrote:
> Fixed a coding style issue

Don't send 8 identically titled patches that each change a single line.

Send one patch, with an updated title like:

	Subject: [PATCH] jsm_tty: Whitespace neatening

that changes _all_ the whitespace that you believe should be updated.

And ideally, instead of just whitespace changes, the code would be
updated to eliminate the code duplication by using temporaries and a
single line conversion.

> diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
[]
> @@ -607,7 +607,7 @@ void jsm_input(struct jsm_channel *ch)
>  				 * Give the Linux ld the flags in the
>  				 * format it likes.
>  				 */
> -				if (*(ch->ch_equeue +tail +i) & UART_LSR_BI)
> +				if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
>  					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
>  				else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
>  					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);

Something like:
---
 drivers/tty/serial/jsm/jsm_tty.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c
index 689774c073ca..b48ca17f38d3 100644
--- a/drivers/tty/serial/jsm/jsm_tty.c
+++ b/drivers/tty/serial/jsm/jsm_tty.c
@@ -607,14 +607,20 @@ void jsm_input(struct jsm_channel *ch)
 				 * Give the Linux ld the flags in the
 				 * format it likes.
 				 */
-				if (*(ch->ch_equeue +tail +i) & UART_LSR_BI)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i),  TTY_BREAK);
-				else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
-				else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
+				u8 error = ch->ch_equeue[tail + i];
+				u8 read = ch->ch_rqueue[tail + i];
+				int type;
+
+				if (error & UART_LSR_BI)
+					type = TTY_BREAK;
+				else if (error & UART_LSR_PE)
+					type = TTY_PARITY;
+				else if (error & UART_LSR_FE)
+					type = TTY_FRAME;
 				else
-					tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
+					type = TTY_NORMAL;
+				tty_insert_flip_char(port, read, type);
+
 			}
 		} else {
 			tty_insert_flip_string(port, ch->ch_rqueue + tail, s);



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-12-06 11:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06  7:39 [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Clement Smith
2020-12-06  7:39 ` [PATCH 2/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 3/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 4/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 5/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 6/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 7/8] " Clement Smith
2020-12-06  7:39 ` [PATCH 8/8] tty: serial: jsm: Removed assignment in if statement Clement Smith
2020-12-06  8:08 ` [PATCH 1/8] tty: serial: jsm: Fixed file by added more spacing Greg KH
2020-12-06 11:04 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).