From 996a776544cc8a71653ffa95a89c317f33d2cb4a Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Tue, 19 Jun 2012 10:34:06 -0400 Subject: USB: serial: Remove unused s_priv variable s_priv was set but never used in keyspan_open() and keyspan_close(), remove it. This also makes the serial variable in keyspan_open() unused since it's only use was to set s_priv, so it is also removed. Signed-off-by: Bill Pemberton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index a1b99243dac9..9a0ca8355905 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -1036,15 +1036,12 @@ static int keyspan_write_room(struct tty_struct *tty) static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) { struct keyspan_port_private *p_priv; - struct keyspan_serial_private *s_priv; - struct usb_serial *serial = port->serial; const struct keyspan_device_details *d_details; int i, err; int baud_rate, device_port; struct urb *urb; unsigned int cflag = 0; - s_priv = usb_get_serial_data(serial); p_priv = usb_get_serial_port_data(port); d_details = p_priv->device_details; @@ -1130,10 +1127,8 @@ static void keyspan_close(struct usb_serial_port *port) { int i; struct usb_serial *serial = port->serial; - struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - s_priv = usb_get_serial_data(serial); p_priv = usb_get_serial_port_data(port); p_priv->rts_state = 0; -- cgit v1.2.3 From 2b982ab177b1698abfde05e3c04d958a65283d63 Mon Sep 17 00:00:00 2001 From: Ben Minerds Date: Thu, 12 Jul 2012 00:10:16 +1000 Subject: USB: serial: keyspan: Fix spacing around conditional. Changes to conform with checkpatch.sh script. - spaces around '?' and ':'. Removed 14 checkpatch.sh errors. Signed-off-by: Ben Minerds Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 9a0ca8355905..7f1a04582183 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -176,7 +176,7 @@ static void keyspan_set_termios(struct tty_struct *tty, tty_encode_baud_rate(tty, baud_rate, baud_rate); /* set CTS/RTS handshake etc. */ p_priv->cflag = cflag; - p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; + p_priv->flow_control = (cflag & CRTSCTS) ? flow_cts : flow_none; /* Mark/Space not supported */ tty->termios->c_cflag &= ~CMSPAR; @@ -1099,7 +1099,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) } /* set CTS/RTS handshake etc. */ p_priv->cflag = cflag; - p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; + p_priv->flow_control = (cflag & CRTSCTS) ? flow_cts : flow_none; keyspan_send_setup(port, 1); /* mdelay(100); */ @@ -1704,7 +1704,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, msg.setPrescaler = 0xff; } - msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; switch (p_priv->cflag & CSIZE) { case CS5: msg.lcr |= USA_DATABITS_5; @@ -1721,7 +1721,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ - msg.lcr |= (p_priv->cflag & PARODD)? + msg.lcr |= (p_priv->cflag & PARODD) ? USA_PARITY_ODD : USA_PARITY_EVEN; } msg.setLcr = 0xff; @@ -1989,7 +1989,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, /* msg.setPrescaler = 0xff; */ } - msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; switch (p_priv->cflag & CSIZE) { case CS5: msg.lcr |= USA_DATABITS_5; @@ -2006,7 +2006,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ - msg.lcr |= (p_priv->cflag & PARODD)? + msg.lcr |= (p_priv->cflag & PARODD) ? USA_PARITY_ODD : USA_PARITY_EVEN; } msg.setLcr = 0xff; @@ -2173,7 +2173,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, msg.txMode = TXMODE_BYHAND; } - msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; switch (p_priv->cflag & CSIZE) { case CS5: msg.lcr |= USA_DATABITS_5; @@ -2190,7 +2190,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ - msg.lcr |= (p_priv->cflag & PARODD)? + msg.lcr |= (p_priv->cflag & PARODD) ? USA_PARITY_ODD : USA_PARITY_EVEN; } if (p_priv->old_cflag != p_priv->cflag) { @@ -2317,7 +2317,7 @@ static int keyspan_usa67_send_setup(struct usb_serial *serial, } if (p_priv->cflag & PARENB) { /* note USA_PARITY_NONE == 0 */ - msg.lcr |= (p_priv->cflag & PARODD)? + msg.lcr |= (p_priv->cflag & PARODD) ? USA_PARITY_ODD : USA_PARITY_EVEN; } msg.setLcr = 0xff; -- cgit v1.2.3 From 40adac81432a1e65cc36b09c0c61b48f3fa292cf Mon Sep 17 00:00:00 2001 From: Ben Minerds Date: Thu, 12 Jul 2012 00:10:17 +1000 Subject: USB: serial: keyspan: Fixed space around equals. Changes to conform with checkpatch.sh script. - space around '='. Removed 1 checkpatch.sh error. Signed-off-by: Ben Minerds Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 7f1a04582183..1524bd5a7363 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -474,7 +474,7 @@ static void usa28_indat_callback(struct urb *urb) p_priv = usb_get_serial_port_data(port); data = urb->transfer_buffer; - tty =tty_port_tty_get(&port->port); + tty = tty_port_tty_get(&port->port); if (tty && urb->actual_length) { tty_insert_flip_string(tty, data, urb->actual_length); tty_flip_buffer_push(tty); -- cgit v1.2.3 From ddc04ae77f6ed8ba60c2387536eeb685e9f5e856 Mon Sep 17 00:00:00 2001 From: Ben Minerds Date: Thu, 12 Jul 2012 00:10:18 +1000 Subject: USB: serial: keyspan: Fixed space near open parenthesis. Changes to conform with checkpatch.sh script. - space near open parenthesis '('. Removed 2 checkpatch.sh errors. Signed-off-by: Ben Minerds Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 1524bd5a7363..9006e574e2a2 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -557,7 +557,7 @@ static void usa28_instat_callback(struct urb *urb) p_priv->dcd_state = ((msg->dcd) ? 1 : 0); p_priv->ri_state = ((msg->ri) ? 1 : 0); - if( old_dcd_state != p_priv->dcd_state && old_dcd_state) { + if (old_dcd_state != p_priv->dcd_state && old_dcd_state) { tty = tty_port_tty_get(&port->port); if (tty && !C_CLOCAL(tty)) tty_hangup(tty); -- cgit v1.2.3 From 878b5fd690acba94f3e9b053f0281f273237ce3a Mon Sep 17 00:00:00 2001 From: Ben Minerds Date: Thu, 12 Jul 2012 00:10:19 +1000 Subject: USB: serial: keyspan: Removed trailing whitespace. Changes to conform with checkpatch.sh script. - trailing whitespace. Removed 1 checkpatch.sh error. Signed-off-by: Ben Minerds Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 9006e574e2a2..5f4b0fb77fb0 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -559,7 +559,7 @@ static void usa28_instat_callback(struct urb *urb) if (old_dcd_state != p_priv->dcd_state && old_dcd_state) { tty = tty_port_tty_get(&port->port); - if (tty && !C_CLOCAL(tty)) + if (tty && !C_CLOCAL(tty)) tty_hangup(tty); tty_kref_put(tty); } -- cgit v1.2.3 From f9943c2596c76e6d5c032d13edb735a73b0cc582 Mon Sep 17 00:00:00 2001 From: Ben Minerds Date: Thu, 12 Jul 2012 00:10:20 +1000 Subject: USB: serial: keyspan: Removed unrequired parentheses. Changes to conform with checkpatch.sh script. - return is not a function, parentheses not required. Removed 1 checkpatch.sh error. Signed-off-by: Ben Minerds Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/keyspan.c') diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 5f4b0fb77fb0..af0b70eaf032 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -1235,7 +1235,7 @@ static int keyspan_fake_startup(struct usb_serial *serial) if (request_ihex_firmware(&fw, fw_name, &serial->dev->dev)) { dev_err(&serial->dev->dev, "Required keyspan firmware image (%s) unavailable.\n", fw_name); - return(1); + return 1; } dbg("Uploading Keyspan %s firmware.", fw_name); -- cgit v1.2.3