Skip to content

Commit e41de61

Browse files
committed
USB: serial: kobil_sct: clean up device type checks
Clean up the driver device type checks by moving logical operators to the previous line and using consistent indentation of continuation lines. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
1 parent ddf8160 commit e41de61

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

drivers/usb/serial/kobil_sct.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
239239
dev_dbg(dev, "%s - Send reset_all_queues URB returns: %i\n", __func__, result);
240240
}
241241
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
242-
priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
243-
priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
242+
priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
243+
priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
244244
/* start reading (Adapter B 'cause PNP string) */
245245
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
246246
dev_dbg(dev, "%s - Send read URB returns: %i\n", __func__, result);
@@ -318,9 +318,10 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
318318
if (((priv->device_type != KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 2) && (priv->filled >= (priv->buf[1] + 3))) ||
319319
((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 3) && (priv->filled >= (priv->buf[2] + 4)))) {
320320
/* stop reading (except TWIN and KAAN SIM) */
321-
if ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID)
322-
|| (priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID))
321+
if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
322+
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
323323
usb_kill_urb(port->interrupt_in_urb);
324+
}
324325

325326
todo = priv->filled - priv->cur_pos;
326327

@@ -347,7 +348,7 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
347348

348349
/* start reading (except TWIN and KAAN SIM) */
349350
if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
350-
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
351+
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
351352
result = usb_submit_urb(port->interrupt_in_urb,
352353
GFP_ATOMIC);
353354
dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
@@ -373,8 +374,8 @@ static int kobil_tiocmget(struct tty_struct *tty)
373374
int transfer_buffer_length = 8;
374375

375376
priv = usb_get_serial_port_data(port);
376-
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
377-
|| priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
377+
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
378+
priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
378379
/* This device doesn't support ioctl calls */
379380
return -EINVAL;
380381
}
@@ -423,8 +424,8 @@ static int kobil_tiocmset(struct tty_struct *tty,
423424
u16 val = 0;
424425

425426
priv = usb_get_serial_port_data(port);
426-
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
427-
|| priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
427+
if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
428+
priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
428429
/* This device doesn't support ioctl calls */
429430
return -EINVAL;
430431
}

0 commit comments

Comments
 (0)