usb: serial: implement CMSPAR for F81232
Subsystems (2)
PATCH v3 5/5 usb: serial: implement CMSPAR for F81232
This patch implement CMSPAR in set_termios,
and fix some warnning from checkpatch.pl
--- drivers/usb/serial/f81232.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/usb/serial/f81232.c +15 -6
@@ -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; }
Signature · 1 line
1.9.1
Hello.
Quoted 2 lines · Peter Hung
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.
Quoted 9 lines
Signed-off-by Peter Hung <[email protected]>--- drivers/usb/serial/f81232.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)drivers/usb/serial/f81232.c +0
-0
[...]
Quoted 13 lines
drivers/usb/serial/f81232.c +5
-4@@ -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
drivers/usb/serial/f81232.c static void f81232_set_termios(struct tty_struct *tty, · line 378
Quoted 10 lines
drivers/usb/serial/f81232.c +8
-0+ | UART_LCR_SPAR); + }else { +if (cflag &PARODD ) + new_lcr |=UART_LCR_PARITY ;/* odd */ +else + new_lcr |=SERIAL_EVEN_PARITY ;/* even */ + } } +
Not needed at all.
drivers/usb/serial/f81232.c static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) · line 457
Quoted 9 lines
drivers/usb/serial/f81232.c +1
-1if (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
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 寫道:
Quoted 62 lines
Hello.
Quoted 2 lines · Peter Hung
This patch implement CMSPAR in
set_termios,
and fix some warnning from checkpatch.plPlease don't try to do 2 unrelated things in one patch.
Quoted 9 lines
Signed-off-by Peter Hung <[email protected]>--- drivers/usb/serial/f81232.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)drivers/usb/serial/f81232.c +0
-0[...]
Quoted 14 lines
drivers/usb/serial/f81232.c +5
-4@@ -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_PARITYdrivers/usb/serial/f81232.c static void f81232_set_termios(struct tty_struct · line 379
Quoted 10 lines
drivers/usb/serial/f81232.c +8
-0+ | UART_LCR_SPAR); + }else { +if (cflag &PARODD ) + new_lcr |=UART_LCR_PARITY ;/* odd */ +else + new_lcr |=SERIAL_EVEN_PARITY ;/* even */ + } } +Not needed at all.
drivers/usb/serial/f81232.c static int f81232_open(struct tty_struct *tty, · line 459
Quoted 11 lines
drivers/usb/serial/f81232.c +0
-0if (cflag &CSTOPB ) new_lcr |=UART_LCR_STOP ;else
drivers/usb/serial/f81232.c +1
-1@@ -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
Signature · 2 lines
With Best Regards, Peter Hung
Hello.
Quoted 1 line · Peter Hung
Hello.
Please don't top-post.
Quoted 3 lines
I had using "
scripts/checkpatch.pl-f" to scan originalf81232.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...
Quoted 2 lines
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.
Quoted 1 line
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.
Quoted 1 line
Thanks for your advice.
WBR, Sergei