LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232
@ 2015-01-28  5:58 Peter Hung
  2015-01-28 12:31 ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Hung @ 2015-01-28  5:58 UTC (permalink / raw)
  To: johan; +Cc: gregkh, linux-usb, linux-kernel, tom_tsai, peter_hong, Peter Hung

This patch implement CMSPAR in set_termios,
and fix some warnning from checkpatch.pl

Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
---
 drivers/usb/serial/f81232.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 11a236b..79592d6 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -175,7 +175,7 @@ static void f81232_read_msr(struct f81232_private *priv)
 
 
 static inline int update_mctrl(struct f81232_private *port_priv,
-					   unsigned int set, unsigned int clear)
+		unsigned int set, unsigned int clear)
 {
 	struct usb_device *dev = port_priv->port->serial->dev;
 	u8 urb_value;
@@ -361,12 +361,21 @@ static void f81232_set_termios(struct tty_struct *tty,
 
 
 	if (cflag & PARENB) {
-		if (cflag & PARODD)
-			new_lcr |= UART_LCR_PARITY; /* odd */
-		else
-			new_lcr |= SERIAL_EVEN_PARITY; /* even */
+		if (cflag & CMSPAR) {
+			if (cflag & PARODD)
+				new_lcr |= (UART_LCR_PARITY | UART_LCR_SPAR);
+			else
+				new_lcr |= (SERIAL_EVEN_PARITY
+							| UART_LCR_SPAR);
+		} else {
+			if (cflag & PARODD)
+				new_lcr |= UART_LCR_PARITY; /* odd */
+			else
+				new_lcr |= SERIAL_EVEN_PARITY; /* even */
+		}
 	}
 
+
 	if (cflag & CSTOPB)
 		new_lcr |= UART_LCR_STOP;
 	else
@@ -445,7 +454,7 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
 
 	result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
 	if (result) {
-		dev_err(&port->dev, "failed submitting interrupt urb, error %d\n",
+		dev_err(&port->dev, "failed submitting urb, error %d\n",
 			result);
 		return result;
 	}
-- 
1.9.1


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

* Re: [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232
  2015-01-28  5:58 [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232 Peter Hung
@ 2015-01-28 12:31 ` Sergei Shtylyov
  2015-01-29  2:01   ` Peter Hung
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2015-01-28 12:31 UTC (permalink / raw)
  To: Peter Hung, johan
  Cc: gregkh, linux-usb, linux-kernel, tom_tsai, peter_hong, Peter Hung

Hello.

On 1/28/2015 8:58 AM, Peter Hung wrote:

> This patch implement CMSPAR in set_termios,
> and fix some warnning from checkpatch.pl

     Please don't try to do 2 unrelated things in one patch.

> Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
> ---
>   drivers/usb/serial/f81232.c | 21 +++++++++++++++------
>   1 file changed, 15 insertions(+), 6 deletions(-)

> diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
> index 11a236b..79592d6 100644
> --- a/drivers/usb/serial/f81232.c
> +++ b/drivers/usb/serial/f81232.c
[...]
> @@ -361,12 +361,21 @@ static void f81232_set_termios(struct tty_struct *tty,
>
>
>   	if (cflag & PARENB) {
> -		if (cflag & PARODD)
> -			new_lcr |= UART_LCR_PARITY; /* odd */
> -		else
> -			new_lcr |= SERIAL_EVEN_PARITY; /* even */
> +		if (cflag & CMSPAR) {
> +			if (cflag & PARODD)
> +				new_lcr |= (UART_LCR_PARITY | UART_LCR_SPAR);
> +			else
> +				new_lcr |= (SERIAL_EVEN_PARITY
> +							| UART_LCR_SPAR);
> +		} else {
> +			if (cflag & PARODD)
> +				new_lcr |= UART_LCR_PARITY; /* odd */
> +			else
> +				new_lcr |= SERIAL_EVEN_PARITY; /* even */
> +		}
>   	}
>
> +

    Not needed at all.

>   	if (cflag & CSTOPB)
>   		new_lcr |= UART_LCR_STOP;
>   	else
> @@ -445,7 +454,7 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
>
>   	result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
>   	if (result) {
> -		dev_err(&port->dev, "failed submitting interrupt urb, error %d\n",
> +		dev_err(&port->dev, "failed submitting urb, error %d\n",

    What are you fixing here?

WBR, Sergei


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

* Re: [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232
  2015-01-28 12:31 ` Sergei Shtylyov
@ 2015-01-29  2:01   ` Peter Hung
  2015-01-29 10:25     ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Hung @ 2015-01-29  2:01 UTC (permalink / raw)
  To: Sergei Shtylyov, johan
  Cc: gregkh, linux-usb, linux-kernel, tom_tsai, peter_hong, Peter Hung

Hello.

I had using "scripts/checkpatch.pl -f" to scan original f81232.c.
It reported with "quoted string split across lines", so I merge these
2 strings into 1 in patch 1/5. But it still warning with "line over 80 
character", so I had shorted string with this line.

I will refine my patch set again with more attention.
Thanks for your advice.

Sergei Shtylyov 於 2015/1/28 下午 08:31 寫道:
> Hello.
>
> On 1/28/2015 8:58 AM, Peter Hung wrote:
>
>> This patch implement CMSPAR in set_termios,
>> and fix some warnning from checkpatch.pl
>
>      Please don't try to do 2 unrelated things in one patch.
>
>> Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
>> ---
>>   drivers/usb/serial/f81232.c | 21 +++++++++++++++------
>>   1 file changed, 15 insertions(+), 6 deletions(-)
>
>> diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
>> index 11a236b..79592d6 100644
>> --- a/drivers/usb/serial/f81232.c
>> +++ b/drivers/usb/serial/f81232.c
> [...]
>> @@ -361,12 +361,21 @@ static void f81232_set_termios(struct tty_struct
>> *tty,
>>
>>
>>       if (cflag & PARENB) {
>> -        if (cflag & PARODD)
>> -            new_lcr |= UART_LCR_PARITY; /* odd */
>> -        else
>> -            new_lcr |= SERIAL_EVEN_PARITY; /* even */
>> +        if (cflag & CMSPAR) {
>> +            if (cflag & PARODD)
>> +                new_lcr |= (UART_LCR_PARITY | UART_LCR_SPAR);
>> +            else
>> +                new_lcr |= (SERIAL_EVEN_PARITY
>> +                            | UART_LCR_SPAR);
>> +        } else {
>> +            if (cflag & PARODD)
>> +                new_lcr |= UART_LCR_PARITY; /* odd */
>> +            else
>> +                new_lcr |= SERIAL_EVEN_PARITY; /* even */
>> +        }
>>       }
>>
>> +
>
>     Not needed at all.
>
>>       if (cflag & CSTOPB)
>>           new_lcr |= UART_LCR_STOP;
>>       else
>> @@ -445,7 +454,7 @@ static int f81232_open(struct tty_struct *tty,
>> struct usb_serial_port *port)
>>
>>       result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
>>       if (result) {
>> -        dev_err(&port->dev, "failed submitting interrupt urb, error
>> %d\n",
>> +        dev_err(&port->dev, "failed submitting urb, error %d\n",
>
>     What are you fixing here?
>
> WBR, Sergei
>

-- 
With Best Regards,
Peter Hung

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

* Re: [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232
  2015-01-29  2:01   ` Peter Hung
@ 2015-01-29 10:25     ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2015-01-29 10:25 UTC (permalink / raw)
  To: Peter Hung, johan
  Cc: gregkh, linux-usb, linux-kernel, tom_tsai, peter_hong, Peter Hung

Hello.

On 1/29/2015 5:01 AM, Peter Hung wrote:

> Hello.

     Please don't top-post.

> I had using "scripts/checkpatch.pl -f" to scan original f81232.c.
> It reported with "quoted string split across lines", so I merge these
> 2 strings into 1 in patch 1/5.

    Seems like another unrelated change...

> But it still warning with "line over 80
> character", so I had shorted string with this line.

    Hm, the modern checkpatch.pl shouldn't warn about long lines due to string 
literals used in dev_err(), etc. calls.

> I will refine my patch set again with more attention.

    In any case, don't leave the warnings till some next patch, fix them at once.

> Thanks for your advice.

WBR, Sergei


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

end of thread, other threads:[~2015-01-29 10:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28  5:58 [PATCH v3 5/5] usb: serial: implement CMSPAR for F81232 Peter Hung
2015-01-28 12:31 ` Sergei Shtylyov
2015-01-29  2:01   ` Peter Hung
2015-01-29 10:25     ` Sergei Shtylyov

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