linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: serial: Fix Coding Style Errors
@ 2022-02-12 17:55 Husni Faiz
  2022-02-14 10:13 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Husni Faiz @ 2022-02-12 17:55 UTC (permalink / raw)
  To: johan, gregkh; +Cc: Husni Faiz, linux-usb, linux-kernel

Added a space before the ternary operator.
Removed the space after the function argument.

Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
---
 drivers/usb/serial/cp210x.c      | 2 +-
 drivers/usb/serial/iuu_phoenix.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 8a60c0d56863..1fcdfb7d118c 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -1403,7 +1403,7 @@ static int cp210x_tiocmget(struct tty_struct *tty)
 		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
 		|((control & CONTROL_CTS) ? TIOCM_CTS : 0)
 		|((control & CONTROL_DSR) ? TIOCM_DSR : 0)
-		|((control & CONTROL_RING)? TIOCM_RI  : 0)
+		|((control & CONTROL_RING) ? TIOCM_RI  : 0)
 		|((control & CONTROL_DCD) ? TIOCM_CD  : 0);
 
 	dev_dbg(&port->dev, "%s - control = 0x%02x\n", __func__, control);
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 0be3b5e1eaf3..2f7784572c4d 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -360,7 +360,7 @@ static void iuu_led_activity_on(struct urb *urb)
 	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
 			  usb_sndbulkpipe(port->serial->dev,
 					  port->bulk_out_endpointAddress),
-			  port->write_urb->transfer_buffer, 8 ,
+			  port->write_urb->transfer_buffer, 8,
 			  iuu_rxcmd, port);
 	usb_submit_urb(port->write_urb, GFP_ATOMIC);
 }
@@ -380,7 +380,7 @@ static void iuu_led_activity_off(struct urb *urb)
 	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
 			  usb_sndbulkpipe(port->serial->dev,
 					  port->bulk_out_endpointAddress),
-			  port->write_urb->transfer_buffer, 8 ,
+			  port->write_urb->transfer_buffer, 8,
 			  iuu_rxcmd, port);
 	usb_submit_urb(port->write_urb, GFP_ATOMIC);
 }
-- 
2.25.1


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

* Re: [PATCH] usb: serial: Fix Coding Style Errors
  2022-02-12 17:55 [PATCH] usb: serial: Fix Coding Style Errors Husni Faiz
@ 2022-02-14 10:13 ` Greg KH
  2022-02-20 13:13 ` [PATCH v2 1/2] usb: serial: Fix Space Prohibited " Husni Faiz
  2022-02-20 13:14 ` [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator Husni Faiz
  2 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-02-14 10:13 UTC (permalink / raw)
  To: Husni Faiz; +Cc: johan, linux-usb, linux-kernel

On Sat, Feb 12, 2022 at 11:25:10PM +0530, Husni Faiz wrote:
> Added a space before the ternary operator.
> Removed the space after the function argument.

That should be 2 different patches, right?

Please learn stuff like this on the drivers/staging/ part of the kernel
first, as patches for this are welcome there and that is a great place
to start.

good luck!

greg k-h

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

* [PATCH v2 1/2] usb: serial: Fix Space Prohibited Coding Style Errors
  2022-02-12 17:55 [PATCH] usb: serial: Fix Coding Style Errors Husni Faiz
  2022-02-14 10:13 ` Greg KH
@ 2022-02-20 13:13 ` Husni Faiz
  2022-02-21  9:37   ` Johan Hovold
  2022-02-20 13:14 ` [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator Husni Faiz
  2 siblings, 1 reply; 6+ messages in thread
From: Husni Faiz @ 2022-02-20 13:13 UTC (permalink / raw)
  To: johan, gregkh; +Cc: Husni Faiz, linux-usb, linux-kernel

This patch fixes "space prohibited before that ','"  checkpatch error.
Removed the space after the function argument value "8".

Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
---
V1->V2 : Separated the style changes into multiple patches.

 drivers/usb/serial/iuu_phoenix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 0be3b5e1eaf3..2f7784572c4d 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -360,7 +360,7 @@ static void iuu_led_activity_on(struct urb *urb)
 	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
 			  usb_sndbulkpipe(port->serial->dev,
 					  port->bulk_out_endpointAddress),
-			  port->write_urb->transfer_buffer, 8 ,
+			  port->write_urb->transfer_buffer, 8,
 			  iuu_rxcmd, port);
 	usb_submit_urb(port->write_urb, GFP_ATOMIC);
 }
@@ -380,7 +380,7 @@ static void iuu_led_activity_off(struct urb *urb)
 	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
 			  usb_sndbulkpipe(port->serial->dev,
 					  port->bulk_out_endpointAddress),
-			  port->write_urb->transfer_buffer, 8 ,
+			  port->write_urb->transfer_buffer, 8,
 			  iuu_rxcmd, port);
 	usb_submit_urb(port->write_urb, GFP_ATOMIC);
 }
-- 
2.25.1


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

* [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator
  2022-02-12 17:55 [PATCH] usb: serial: Fix Coding Style Errors Husni Faiz
  2022-02-14 10:13 ` Greg KH
  2022-02-20 13:13 ` [PATCH v2 1/2] usb: serial: Fix Space Prohibited " Husni Faiz
@ 2022-02-20 13:14 ` Husni Faiz
  2022-02-21  9:39   ` Johan Hovold
  2 siblings, 1 reply; 6+ messages in thread
From: Husni Faiz @ 2022-02-20 13:14 UTC (permalink / raw)
  To: johan, gregkh; +Cc: Husni Faiz, linux-usb, linux-kernel

This patch fixes "spaces required around that '?'"  checkpatch error
Added a space before the "?" ternary operator.

Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
---
V1->V2 : Separated the style changes into multiple patches.

 drivers/usb/serial/cp210x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 8a60c0d56863..1fcdfb7d118c 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -1403,7 +1403,7 @@ static int cp210x_tiocmget(struct tty_struct *tty)
 		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
 		|((control & CONTROL_CTS) ? TIOCM_CTS : 0)
 		|((control & CONTROL_DSR) ? TIOCM_DSR : 0)
-		|((control & CONTROL_RING)? TIOCM_RI  : 0)
+		|((control & CONTROL_RING) ? TIOCM_RI  : 0)
 		|((control & CONTROL_DCD) ? TIOCM_CD  : 0);
 
 	dev_dbg(&port->dev, "%s - control = 0x%02x\n", __func__, control);
-- 
2.25.1


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

* Re: [PATCH v2 1/2] usb: serial: Fix Space Prohibited Coding Style Errors
  2022-02-20 13:13 ` [PATCH v2 1/2] usb: serial: Fix Space Prohibited " Husni Faiz
@ 2022-02-21  9:37   ` Johan Hovold
  0 siblings, 0 replies; 6+ messages in thread
From: Johan Hovold @ 2022-02-21  9:37 UTC (permalink / raw)
  To: Husni Faiz; +Cc: gregkh, linux-usb, linux-kernel

On Sun, Feb 20, 2022 at 06:43:39PM +0530, Husni Faiz wrote:
> This patch fixes "space prohibited before that ','"  checkpatch error.
> Removed the space after the function argument value "8".
> 
> Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
> ---
> V1->V2 : Separated the style changes into multiple patches.

As Greg mentioned, please work in drivers/staging if you want to submit
these kind of patches.

checkpatch.pl is great for checking your own patches before submission,
but it shouldn't be run on code that's already in the tree, and where
fixing a white space issue like this one has essentially no value.

And as your staging/greybus submission showed, using the output of tools
like checkpatch.pl even risks breaking things if you take it too
literally and don't use your own judgement.

>  drivers/usb/serial/iuu_phoenix.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
> index 0be3b5e1eaf3..2f7784572c4d 100644
> --- a/drivers/usb/serial/iuu_phoenix.c
> +++ b/drivers/usb/serial/iuu_phoenix.c
> @@ -360,7 +360,7 @@ static void iuu_led_activity_on(struct urb *urb)
>  	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
>  			  usb_sndbulkpipe(port->serial->dev,
>  					  port->bulk_out_endpointAddress),
> -			  port->write_urb->transfer_buffer, 8 ,
> +			  port->write_urb->transfer_buffer, 8,
>  			  iuu_rxcmd, port);
>  	usb_submit_urb(port->write_urb, GFP_ATOMIC);
>  }
> @@ -380,7 +380,7 @@ static void iuu_led_activity_off(struct urb *urb)
>  	usb_fill_bulk_urb(port->write_urb, port->serial->dev,
>  			  usb_sndbulkpipe(port->serial->dev,
>  					  port->bulk_out_endpointAddress),
> -			  port->write_urb->transfer_buffer, 8 ,
> +			  port->write_urb->transfer_buffer, 8,
>  			  iuu_rxcmd, port);
>  	usb_submit_urb(port->write_urb, GFP_ATOMIC);
>  }

Johan

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

* Re: [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator
  2022-02-20 13:14 ` [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator Husni Faiz
@ 2022-02-21  9:39   ` Johan Hovold
  0 siblings, 0 replies; 6+ messages in thread
From: Johan Hovold @ 2022-02-21  9:39 UTC (permalink / raw)
  To: Husni Faiz; +Cc: gregkh, linux-usb, linux-kernel

On Sun, Feb 20, 2022 at 06:44:05PM +0530, Husni Faiz wrote:
> This patch fixes "spaces required around that '?'"  checkpatch error
> Added a space before the "?" ternary operator.
> 
> Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
> ---
> V1->V2 : Separated the style changes into multiple patches.
> 
>  drivers/usb/serial/cp210x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
> index 8a60c0d56863..1fcdfb7d118c 100644
> --- a/drivers/usb/serial/cp210x.c
> +++ b/drivers/usb/serial/cp210x.c
> @@ -1403,7 +1403,7 @@ static int cp210x_tiocmget(struct tty_struct *tty)
>  		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
>  		|((control & CONTROL_CTS) ? TIOCM_CTS : 0)
>  		|((control & CONTROL_DSR) ? TIOCM_DSR : 0)
> -		|((control & CONTROL_RING)? TIOCM_RI  : 0)
> +		|((control & CONTROL_RING) ? TIOCM_RI  : 0)
>  		|((control & CONTROL_DCD) ? TIOCM_CD  : 0);

I'm pretty sure the author intended the TIOCM arguments to be aligned
here.

But in any case, I'm not taking checkpatch.pl clean ups unless you're
also doing real changes to the code in question.

>  	dev_dbg(&port->dev, "%s - control = 0x%02x\n", __func__, control);

Johan

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

end of thread, other threads:[~2022-02-21 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-12 17:55 [PATCH] usb: serial: Fix Coding Style Errors Husni Faiz
2022-02-14 10:13 ` Greg KH
2022-02-20 13:13 ` [PATCH v2 1/2] usb: serial: Fix Space Prohibited " Husni Faiz
2022-02-21  9:37   ` Johan Hovold
2022-02-20 13:14 ` [PATCH v2 2/2] usb: serial: Fix Coding Style Error Around Ternary Operator Husni Faiz
2022-02-21  9:39   ` Johan Hovold

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).