[PATCH 2/2] USB: ftdi_sio: fix some coding style issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mainly whitespace changes and some bracing style clean-ups.

Signed-off-by: Jaša Bartelj <jasa.bartelj@xxxxxxxxx>
---
 drivers/usb/serial/ftdi_sio.c     | 20 +++++++++++---------
 drivers/usb/serial/ftdi_sio_ids.h |  4 ++--
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 19cf267..620845b 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -58,7 +58,7 @@ struct ftdi_private {
 	int custom_divisor;	/* custom_divisor kludge, this is for
 				   baud_base (different from what goes to the
 				   chip!) */
-	__u16 last_set_data_urb_value ;
+	__u16 last_set_data_urb_value;
 				/* the last data state set - needed for doing
 				 * a break
 				 */
@@ -1038,6 +1038,7 @@ static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
 	unsigned short int divisor;
 	/* divisor shifted 3 bits to the left */
 	int divisor3 = base / 2 / baud;
+
 	if ((divisor3 & 0x7) == 7)
 		divisor3++; /* round x.7/8 up to x+1 */
 	divisor = divisor3 >> 3;
@@ -1064,6 +1065,7 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
 	__u32 divisor;
 	/* divisor shifted 3 bits to the left */
 	int divisor3 = base / 2 / baud;
+
 	divisor = divisor3 >> 3;
 	divisor |= (__u32)divfrac[divisor3 & 0x7] << 14;
 	/* Deal with special cases for highest baud rates. */
@@ -1450,8 +1452,7 @@ check_and_exit:
 	     (old_priv.custom_divisor != priv->custom_divisor))) {
 		change_speed(tty, port);
 		mutex_unlock(&priv->cfg_lock);
-	}
-	else
+	} else
 		mutex_unlock(&priv->cfg_lock);
 	return 0;
 }
@@ -1507,15 +1508,15 @@ static void ftdi_determine_type(struct usb_serial_port *port)
 
 		/* Determine interface code. */
 		inter = serial->interface->altsetting->desc.bInterfaceNumber;
-		if (inter == 0) {
+		if (inter == 0)
 			priv->interface = INTERFACE_A;
-		} else  if (inter == 1) {
+		else  if (inter == 1)
 			priv->interface = INTERFACE_B;
-		} else  if (inter == 2) {
+		else  if (inter == 2)
 			priv->interface = INTERFACE_C;
-		} else  if (inter == 3) {
+		else  if (inter == 3)
 			priv->interface = INTERFACE_D;
-		}
+
 		/* BM-type devices have a bug where bcdDevice gets set
 		 * to 0x200 when iSerialNumber is 0.  */
 		if (version < 0x500) {
@@ -1598,6 +1599,7 @@ static ssize_t latency_timer_show(struct device *dev,
 {
 	struct usb_serial_port *port = to_usb_serial_port(dev);
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
+
 	if (priv->flags & ASYNC_LOW_LATENCY)
 		return sprintf(buf, "1\n");
 	else
@@ -1710,6 +1712,7 @@ static int ftdi_sio_probe(struct usb_serial *serial,
 
 	if (quirk && quirk->probe) {
 		int ret = quirk->probe(serial);
+
 		if (ret != 0)
 			return ret;
 	}
@@ -1724,7 +1727,6 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
 	struct ftdi_private *priv;
 	struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
 
-
 	priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index f585eb7..c16d330 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -897,7 +897,7 @@
  * Kondo Kagaku Co.Ltd.
  * http://www.kondo-robot.com/EN
  */
-#define KONDO_VID 		0x165c
+#define KONDO_VID		0x165c
 #define KONDO_USB_SERIAL_PID	0x0002
 
 /*
@@ -1284,7 +1284,7 @@
 /*
  * Accesio USB Data Acquisition products (http://www.accesio.com/)
  */
-#define ACCESIO_COM4SM_PID 	0xD578
+#define ACCESIO_COM4SM_PID	0xD578
 
 /* www.sciencescope.co.uk educational dataloggers */
 #define FTDI_SCIENCESCOPE_LOGBOOKML_PID		0xFF18
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux