aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-03-12 14:09:41 -0400
committerGreg Kroah-Hartman <greg@kroah.com>2014-03-12 15:44:50 -0400
commitca0400d2caf0d6f18445feea79c8c5a4ccf77e61 (patch)
tree6aa0f9a9d0d8ce16aac3348c82a236594086edaf
parentbd58c7bd6fd5f803b4127717bda9cc6c30d0c806 (diff)
USB: serial: add missing braces
Add missing braces to conditional branches and one loop in usb-serial core and generic implementation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-rw-r--r--drivers/usb/serial/generic.c11
-rw-r--r--drivers/usb/serial/usb-serial.c8
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 33d7f4092308..1bd192290b08 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -332,9 +332,9 @@ void usb_serial_generic_process_read_urb(struct urb *urb)
332 * stuff like 3G modems, so shortcircuit it in the 99.9999999% of 332 * stuff like 3G modems, so shortcircuit it in the 99.9999999% of
333 * cases where the USB serial is not a console anyway. 333 * cases where the USB serial is not a console anyway.
334 */ 334 */
335 if (!port->port.console || !port->sysrq) 335 if (!port->port.console || !port->sysrq) {
336 tty_insert_flip_string(&port->port, ch, urb->actual_length); 336 tty_insert_flip_string(&port->port, ch, urb->actual_length);
337 else { 337 } else {
338 for (i = 0; i < urb->actual_length; i++, ch++) { 338 for (i = 0; i < urb->actual_length; i++, ch++) {
339 if (!usb_serial_handle_sysrq_char(port, *ch)) 339 if (!usb_serial_handle_sysrq_char(port, *ch))
340 tty_insert_flip_char(&port->port, *ch, TTY_NORMAL); 340 tty_insert_flip_char(&port->port, *ch, TTY_NORMAL);
@@ -388,8 +388,9 @@ resubmit:
388 if (!port->throttled) { 388 if (!port->throttled) {
389 spin_unlock_irqrestore(&port->lock, flags); 389 spin_unlock_irqrestore(&port->lock, flags);
390 usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC); 390 usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC);
391 } else 391 } else {
392 spin_unlock_irqrestore(&port->lock, flags); 392 spin_unlock_irqrestore(&port->lock, flags);
393 }
393} 394}
394EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback); 395EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
395 396
@@ -399,10 +400,10 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
399 struct usb_serial_port *port = urb->context; 400 struct usb_serial_port *port = urb->context;
400 int i; 401 int i;
401 402
402 for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) 403 for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) {
403 if (port->write_urbs[i] == urb) 404 if (port->write_urbs[i] == urb)
404 break; 405 break;
405 406 }
406 spin_lock_irqsave(&port->lock, flags); 407 spin_lock_irqsave(&port->lock, flags);
407 port->tx_bytes -= urb->transfer_buffer_length; 408 port->tx_bytes -= urb->transfer_buffer_length;
408 set_bit(i, &port->write_urbs_free); 409 set_bit(i, &port->write_urbs_free);
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index c68fc9fb7598..4c3aeaf56dc1 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1160,9 +1160,9 @@ static int usb_serial_reset_resume(struct usb_interface *intf)
1160 usb_serial_unpoison_port_urbs(serial); 1160 usb_serial_unpoison_port_urbs(serial);
1161 1161
1162 serial->suspending = 0; 1162 serial->suspending = 0;
1163 if (serial->type->reset_resume) 1163 if (serial->type->reset_resume) {
1164 rv = serial->type->reset_resume(serial); 1164 rv = serial->type->reset_resume(serial);
1165 else { 1165 } else {
1166 rv = -EOPNOTSUPP; 1166 rv = -EOPNOTSUPP;
1167 intf->needs_binding = 1; 1167 intf->needs_binding = 1;
1168 } 1168 }
@@ -1337,9 +1337,9 @@ static int usb_serial_register(struct usb_serial_driver *driver)
1337 if (retval) { 1337 if (retval) {
1338 pr_err("problem %d when registering driver %s\n", retval, driver->description); 1338 pr_err("problem %d when registering driver %s\n", retval, driver->description);
1339 list_del(&driver->driver_list); 1339 list_del(&driver->driver_list);
1340 } else 1340 } else {
1341 pr_info("USB Serial support registered for %s\n", driver->description); 1341 pr_info("USB Serial support registered for %s\n", driver->description);
1342 1342 }
1343 mutex_unlock(&table_lock); 1343 mutex_unlock(&table_lock);
1344 return retval; 1344 return retval;
1345} 1345}