diff mbox series

[v2,2/2] usb: serial: Fix Coding Style Error Around Ternary Operator

Message ID 20220220131405.179732-1-ahamedhusni73@gmail.com
State New
Headers show
Series [v2,1/2] usb: serial: Fix Space Prohibited Coding Style Errors | expand

Commit Message

Ahamed Husni Feb. 20, 2022, 1:14 p.m. UTC
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(-)

Comments

Johan Hovold Feb. 21, 2022, 9:39 a.m. UTC | #1
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
diff mbox series

Patch

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