提交 63b00612 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

USB: ftdi_sio: remove unused rx_byte counter

Remove unused rx_byte counter which is never exposed as noted by Alan
Cox.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0cbd81a9
...@@ -81,7 +81,6 @@ struct ftdi_private { ...@@ -81,7 +81,6 @@ struct ftdi_private {
struct delayed_work rx_work; struct delayed_work rx_work;
struct usb_serial_port *port; struct usb_serial_port *port;
int rx_processed; int rx_processed;
unsigned long rx_bytes;
__u16 interface; /* FT2232C, FT2232H or FT4232H port interface __u16 interface; /* FT2232C, FT2232H or FT4232H port interface
(0 for FT232/245) */ (0 for FT232/245) */
...@@ -1699,9 +1698,6 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1699,9 +1698,6 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
spin_lock_irqsave(&priv->tx_lock, flags); spin_lock_irqsave(&priv->tx_lock, flags);
priv->tx_bytes = 0; priv->tx_bytes = 0;
spin_unlock_irqrestore(&priv->tx_lock, flags); spin_unlock_irqrestore(&priv->tx_lock, flags);
spin_lock_irqsave(&priv->rx_lock, flags);
priv->rx_bytes = 0;
spin_unlock_irqrestore(&priv->rx_lock, flags);
write_latency_timer(port); write_latency_timer(port);
...@@ -2014,8 +2010,6 @@ static void ftdi_read_bulk_callback(struct urb *urb) ...@@ -2014,8 +2010,6 @@ static void ftdi_read_bulk_callback(struct urb *urb)
struct usb_serial_port *port = urb->context; struct usb_serial_port *port = urb->context;
struct tty_struct *tty; struct tty_struct *tty;
struct ftdi_private *priv; struct ftdi_private *priv;
unsigned long countread;
unsigned long flags;
int status = urb->status; int status = urb->status;
if (urb->number_of_packets > 0) { if (urb->number_of_packets > 0) {
...@@ -2054,13 +2048,6 @@ static void ftdi_read_bulk_callback(struct urb *urb) ...@@ -2054,13 +2048,6 @@ static void ftdi_read_bulk_callback(struct urb *urb)
goto out; goto out;
} }
/* count data bytes, but not status bytes */
countread = urb->actual_length;
countread -= 2 * DIV_ROUND_UP(countread, priv->max_packet_size);
spin_lock_irqsave(&priv->rx_lock, flags);
priv->rx_bytes += countread;
spin_unlock_irqrestore(&priv->rx_lock, flags);
ftdi_process_read(&priv->rx_work.work); ftdi_process_read(&priv->rx_work.work);
out: out:
tty_kref_put(tty); tty_kref_put(tty);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册