Commit ab4cc4ef authored by Johan Hovold's avatar Johan Hovold

USB: serial: ftdi_sio: make process-packet buffer unsigned

Use an unsigned type for the process-packet buffer argument and give it
a more apt name.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 74b76256
...@@ -2480,12 +2480,12 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port, ...@@ -2480,12 +2480,12 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port,
#define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE)
static int ftdi_process_packet(struct usb_serial_port *port, static int ftdi_process_packet(struct usb_serial_port *port,
struct ftdi_private *priv, char *packet, int len) struct ftdi_private *priv, unsigned char *buf, int len)
{ {
unsigned char status;
unsigned char *ch;
int i; int i;
char status;
char flag; char flag;
char *ch;
if (len < 2) { if (len < 2) {
dev_dbg(&port->dev, "malformed packet\n"); dev_dbg(&port->dev, "malformed packet\n");
...@@ -2495,7 +2495,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, ...@@ -2495,7 +2495,7 @@ static int ftdi_process_packet(struct usb_serial_port *port,
/* Compare new line status to the old one, signal if different/ /* Compare new line status to the old one, signal if different/
N.B. packet may be processed more than once, but differences N.B. packet may be processed more than once, but differences
are only processed once. */ are only processed once. */
status = packet[0] & FTDI_STATUS_B0_MASK; status = buf[0] & FTDI_STATUS_B0_MASK;
if (status != priv->prev_status) { if (status != priv->prev_status) {
char diff_status = status ^ priv->prev_status; char diff_status = status ^ priv->prev_status;
...@@ -2521,7 +2521,7 @@ static int ftdi_process_packet(struct usb_serial_port *port, ...@@ -2521,7 +2521,7 @@ static int ftdi_process_packet(struct usb_serial_port *port,
} }
/* save if the transmitter is empty or not */ /* save if the transmitter is empty or not */
if (packet[1] & FTDI_RS_TEMT) if (buf[1] & FTDI_RS_TEMT)
priv->transmit_empty = 1; priv->transmit_empty = 1;
else else
priv->transmit_empty = 0; priv->transmit_empty = 0;
...@@ -2535,29 +2535,29 @@ static int ftdi_process_packet(struct usb_serial_port *port, ...@@ -2535,29 +2535,29 @@ static int ftdi_process_packet(struct usb_serial_port *port,
* data payload to avoid over-reporting. * data payload to avoid over-reporting.
*/ */
flag = TTY_NORMAL; flag = TTY_NORMAL;
if (packet[1] & FTDI_RS_ERR_MASK) { if (buf[1] & FTDI_RS_ERR_MASK) {
/* Break takes precedence over parity, which takes precedence /* Break takes precedence over parity, which takes precedence
* over framing errors */ * over framing errors */
if (packet[1] & FTDI_RS_BI) { if (buf[1] & FTDI_RS_BI) {
flag = TTY_BREAK; flag = TTY_BREAK;
port->icount.brk++; port->icount.brk++;
usb_serial_handle_break(port); usb_serial_handle_break(port);
} else if (packet[1] & FTDI_RS_PE) { } else if (buf[1] & FTDI_RS_PE) {
flag = TTY_PARITY; flag = TTY_PARITY;
port->icount.parity++; port->icount.parity++;
} else if (packet[1] & FTDI_RS_FE) { } else if (buf[1] & FTDI_RS_FE) {
flag = TTY_FRAME; flag = TTY_FRAME;
port->icount.frame++; port->icount.frame++;
} }
/* Overrun is special, not associated with a char */ /* Overrun is special, not associated with a char */
if (packet[1] & FTDI_RS_OE) { if (buf[1] & FTDI_RS_OE) {
port->icount.overrun++; port->icount.overrun++;
tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
} }
} }
port->icount.rx += len; port->icount.rx += len;
ch = packet + 2; ch = buf + 2;
if (port->port.console && port->sysrq) { if (port->port.console && port->sysrq) {
for (i = 0; i < len; i++, ch++) { for (i = 0; i < len; i++, ch++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment