aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2009-12-24 06:42:11 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:53:39 -0500
commitc1284d7726c57c9d2bbc65cd08173fe7f9e637df (patch)
tree7e14950ebc97a422a16cb8bf774797df49c0ea1b /drivers/usb/serial/ftdi_sio.c
parenta3f8168b7a3a7d9dfb9bb9caa1e009a5ce2a8493 (diff)
USB: ftdi_sio: remove unnecessary initialisations
Return values are being initialised to zero only to be unconditionally assigned to a few instructions later. This may give the impression that zero is returned on success, which is not the case. Note also that ftdi_NDI_device_setup never reports errors. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 58698a6f837b..37db5a09a534 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1142,7 +1142,7 @@ static int write_latency_timer(struct usb_serial_port *port)
1142{ 1142{
1143 struct ftdi_private *priv = usb_get_serial_port_data(port); 1143 struct ftdi_private *priv = usb_get_serial_port_data(port);
1144 struct usb_device *udev = port->serial->dev; 1144 struct usb_device *udev = port->serial->dev;
1145 int rv = 0; 1145 int rv;
1146 int l = priv->latency; 1146 int l = priv->latency;
1147 1147
1148 if (priv->flags & ASYNC_LOW_LATENCY) 1148 if (priv->flags & ASYNC_LOW_LATENCY)
@@ -1166,7 +1166,7 @@ static int read_latency_timer(struct usb_serial_port *port)
1166 struct ftdi_private *priv = usb_get_serial_port_data(port); 1166 struct ftdi_private *priv = usb_get_serial_port_data(port);
1167 struct usb_device *udev = port->serial->dev; 1167 struct usb_device *udev = port->serial->dev;
1168 unsigned char *buf; 1168 unsigned char *buf;
1169 int rv = 0; 1169 int rv;
1170 1170
1171 dbg("%s", __func__); 1171 dbg("%s", __func__);
1172 1172
@@ -1360,7 +1360,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
1360 struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; 1360 struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc;
1361 1361
1362 unsigned num_endpoints; 1362 unsigned num_endpoints;
1363 int i = 0; 1363 int i;
1364 1364
1365 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 1365 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints;
1366 dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 1366 dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints);
@@ -1412,7 +1412,7 @@ static ssize_t store_latency_timer(struct device *dev,
1412 struct usb_serial_port *port = to_usb_serial_port(dev); 1412 struct usb_serial_port *port = to_usb_serial_port(dev);
1413 struct ftdi_private *priv = usb_get_serial_port_data(port); 1413 struct ftdi_private *priv = usb_get_serial_port_data(port);
1414 int v = simple_strtoul(valbuf, NULL, 10); 1414 int v = simple_strtoul(valbuf, NULL, 10);
1415 int rv = 0; 1415 int rv;
1416 1416
1417 priv->latency = v; 1417 priv->latency = v;
1418 rv = write_latency_timer(port); 1418 rv = write_latency_timer(port);
@@ -1430,7 +1430,7 @@ static ssize_t store_event_char(struct device *dev,
1430 struct ftdi_private *priv = usb_get_serial_port_data(port); 1430 struct ftdi_private *priv = usb_get_serial_port_data(port);
1431 struct usb_device *udev = port->serial->dev; 1431 struct usb_device *udev = port->serial->dev;
1432 int v = simple_strtoul(valbuf, NULL, 10); 1432 int v = simple_strtoul(valbuf, NULL, 10);
1433 int rv = 0; 1433 int rv;
1434 1434
1435 dbg("%s: setting event char = %i", __func__, v); 1435 dbg("%s: setting event char = %i", __func__, v);
1436 1436
@@ -1617,7 +1617,6 @@ static int ftdi_NDI_device_setup(struct usb_serial *serial)
1617{ 1617{
1618 struct usb_device *udev = serial->dev; 1618 struct usb_device *udev = serial->dev;
1619 int latency = ndi_latency_timer; 1619 int latency = ndi_latency_timer;
1620 int rv = 0;
1621 1620
1622 if (latency == 0) 1621 if (latency == 0)
1623 latency = 1; 1622 latency = 1;
@@ -1627,7 +1626,8 @@ static int ftdi_NDI_device_setup(struct usb_serial *serial)
1627 dbg("%s setting NDI device latency to %d", __func__, latency); 1626 dbg("%s setting NDI device latency to %d", __func__, latency);
1628 dev_info(&udev->dev, "NDI device with a latency value of %d", latency); 1627 dev_info(&udev->dev, "NDI device with a latency value of %d", latency);
1629 1628
1630 rv = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 1629 /* FIXME: errors are not returned */
1630 usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
1631 FTDI_SIO_SET_LATENCY_TIMER_REQUEST, 1631 FTDI_SIO_SET_LATENCY_TIMER_REQUEST,
1632 FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE, 1632 FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE,
1633 latency, 0, NULL, 0, WDR_TIMEOUT); 1633 latency, 0, NULL, 0, WDR_TIMEOUT);
@@ -1718,7 +1718,7 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
1718 struct usb_device *dev = port->serial->dev; 1718 struct usb_device *dev = port->serial->dev;
1719 struct ftdi_private *priv = usb_get_serial_port_data(port); 1719 struct ftdi_private *priv = usb_get_serial_port_data(port);
1720 unsigned long flags; 1720 unsigned long flags;
1721 int result = 0; 1721 int result;
1722 1722
1723 dbg("%s", __func__); 1723 dbg("%s", __func__);
1724 1724
@@ -2137,7 +2137,7 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
2137{ 2137{
2138 struct usb_serial_port *port = tty->driver_data; 2138 struct usb_serial_port *port = tty->driver_data;
2139 struct ftdi_private *priv = usb_get_serial_port_data(port); 2139 struct ftdi_private *priv = usb_get_serial_port_data(port);
2140 __u16 urb_value = 0; 2140 __u16 urb_value;
2141 2141
2142 /* break_state = -1 to turn on break, and 0 to turn off break */ 2142 /* break_state = -1 to turn on break, and 0 to turn off break */
2143 /* see drivers/char/tty_io.c to see it used */ 2143 /* see drivers/char/tty_io.c to see it used */