Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
ca0400d2 bd58c7bd

+10 -9
+6 -5
drivers/usb/serial/generic.c
··· 332 332 * stuff like 3G modems, so shortcircuit it in the 99.9999999% of 333 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 336 tty_insert_flip_string(&port->port, ch, urb->actual_length); 337 - else { 337 + } else { 338 338 for (i = 0; i < urb->actual_length; i++, ch++) { 339 339 if (!usb_serial_handle_sysrq_char(port, *ch)) 340 340 tty_insert_flip_char(&port->port, *ch, TTY_NORMAL); ··· 388 388 if (!port->throttled) { 389 389 spin_unlock_irqrestore(&port->lock, flags); 390 390 usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC); 391 - } else 391 + } else { 392 392 spin_unlock_irqrestore(&port->lock, flags); 393 + } 393 394 } 394 395 EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback); 395 396 ··· 400 399 struct usb_serial_port *port = urb->context; 401 400 int i; 402 401 403 - for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) 402 + for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) { 404 403 if (port->write_urbs[i] == urb) 405 404 break; 406 - 405 + } 407 406 spin_lock_irqsave(&port->lock, flags); 408 407 port->tx_bytes -= urb->transfer_buffer_length; 409 408 set_bit(i, &port->write_urbs_free);
+4 -4
drivers/usb/serial/usb-serial.c
··· 1160 1160 usb_serial_unpoison_port_urbs(serial); 1161 1161 1162 1162 serial->suspending = 0; 1163 - if (serial->type->reset_resume) 1163 + if (serial->type->reset_resume) { 1164 1164 rv = serial->type->reset_resume(serial); 1165 - else { 1165 + } else { 1166 1166 rv = -EOPNOTSUPP; 1167 1167 intf->needs_binding = 1; 1168 1168 } ··· 1337 1337 if (retval) { 1338 1338 pr_err("problem %d when registering driver %s\n", retval, driver->description); 1339 1339 list_del(&driver->driver_list); 1340 - } else 1340 + } else { 1341 1341 pr_info("USB Serial support registered for %s\n", driver->description); 1342 - 1342 + } 1343 1343 mutex_unlock(&table_lock); 1344 1344 return retval; 1345 1345 }