ChangeSet 1.1637, 2004/05/14 10:53:59-07:00, [EMAIL PROTECTED]
USB: removed port_paranoia_check() call for usb serial drivers.
Pretty useless stuff. If this was hiding anything real, we need to find out.
drivers/usb/serial/belkin_sa.c | 6 ---
drivers/usb/serial/cyberjack.c | 6 ---
drivers/usb/serial/digi_acceleport.c | 13 +-----
drivers/usb/serial/empeg.c | 12 ------
drivers/usb/serial/ftdi_sio.c | 6 ---
drivers/usb/serial/generic.c | 3 -
drivers/usb/serial/io_edgeport.c | 67 ++++++++++++-----------------------
drivers/usb/serial/io_ti.c | 14 -------
drivers/usb/serial/ipaq.c | 15 -------
drivers/usb/serial/ir-usb.c | 12 ------
drivers/usb/serial/keyspan_pda.c | 9 ----
drivers/usb/serial/kobil_sct.c | 3 -
drivers/usb/serial/omninet.c | 11 -----
drivers/usb/serial/pl2303.c | 11 -----
drivers/usb/serial/usb-serial.h | 19 ---------
drivers/usb/serial/visor.c | 12 ------
16 files changed, 27 insertions(+), 192 deletions(-)
diff -Nru a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
--- a/drivers/usb/serial/belkin_sa.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/belkin_sa.c Fri May 14 15:27:29 2004
@@ -246,9 +246,6 @@
{
struct usb_serial *serial;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
serial = get_usb_serial (port, __FUNCTION__);
if (!serial)
return;
@@ -287,9 +284,6 @@
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
-
- if (port_paranoia_check (port, __FUNCTION__))
- return;
serial = port->serial;
diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/cyberjack.c Fri May 14 15:27:29 2004
@@ -155,9 +155,6 @@
unsigned long flags;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
dbg("%s - usb_clear_halt", __FUNCTION__ );
@@ -324,9 +321,6 @@
struct usb_serial *serial;
unsigned char *data = urb->transfer_buffer;
int result;
-
- if (port_paranoia_check (port, __FUNCTION__))
- return;
dbg("%s - port %d", __FUNCTION__, port->number);
diff -Nru a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
--- a/drivers/usb/serial/digi_acceleport.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/digi_acceleport.c Fri May 14 15:27:29 2004
@@ -1397,8 +1397,7 @@
}
/* further sanity checks */
- if( port_paranoia_check( port, __FUNCTION__ )
- || serial_paranoia_check( serial, __FUNCTION__ ) )
+ if (serial_paranoia_check(serial, __FUNCTION__))
return;
/* try to send any buffered data on this port, if it is open */
@@ -1851,11 +1850,6 @@
unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
int flag,throttled;
-
- /* sanity check */
- if( port_paranoia_check( port, __FUNCTION__ ) )
- return( -1 );
-
/* do not process callbacks on closed ports */
/* but do continue the read chain */
if( port->open_count == 0 )
@@ -1980,9 +1974,8 @@
port = serial->port[line];
- if( port_paranoia_check( port, __FUNCTION__ )
- || (priv=usb_get_serial_port_data(port)) == NULL )
- return( -1 );
+ if ((priv=usb_get_serial_port_data(port)) == NULL )
+ return -1;
if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) {
diff -Nru a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
--- a/drivers/usb/serial/empeg.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/empeg.c Fri May 14 15:27:29 2004
@@ -157,9 +157,6 @@
struct usb_serial *serial = port->serial;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
/* Force default termio settings */
@@ -192,9 +189,6 @@
{
struct usb_serial *serial;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -353,9 +347,6 @@
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
@@ -375,9 +366,6 @@
unsigned char *data = urb->transfer_buffer;
int i;
int result;
-
- if (port_paranoia_check (port, __FUNCTION__))
- return;
dbg("%s - port %d", __FUNCTION__, port->number);
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/ftdi_sio.c Fri May 14 15:27:29 2004
@@ -1513,9 +1513,6 @@
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
@@ -1577,9 +1574,6 @@
dbg("%s", __FUNCTION__);
- if (port_paranoia_check (port, __FUNCTION__)) {
- return;
- }
if (port->open_count <= 0)
return;
diff -Nru a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
--- a/drivers/usb/serial/generic.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/generic.c Fri May 14 15:27:29 2004
@@ -83,9 +83,6 @@
struct usb_serial *serial = port->serial;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
/* force low_latency on so that our tty_push actually forces the data through,
diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
--- a/drivers/usb/serial/io_edgeport.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/io_edgeport.c Fri May 14 15:27:29 2004
@@ -825,19 +825,17 @@
txCredits = data[position] | (data[position+1] << 8);
if (txCredits) {
port = edge_serial->serial->port[portNumber];
- if (port_paranoia_check (port, __FUNCTION__) == 0) {
- edge_port = usb_get_serial_port_data(port);
- if (edge_port->open) {
- edge_port->txCredits += txCredits;
- dbg("%s - txcredits for port%d = %d",
__FUNCTION__, portNumber, edge_port->txCredits);
-
- /* tell the tty driver that something
has changed */
- if (edge_port->port->tty)
-
wake_up_interruptible(&edge_port->port->tty->write_wait);
+ edge_port = usb_get_serial_port_data(port);
+ if (edge_port->open) {
+ edge_port->txCredits += txCredits;
+ dbg("%s - txcredits for port%d = %d",
__FUNCTION__, portNumber, edge_port->txCredits);
+
+ /* tell the tty driver that something has
changed */
+ if (edge_port->port->tty)
+
wake_up_interruptible(&edge_port->port->tty->write_wait);
- // Since we have more credit, check if
more data can be sent
- send_more_port_data(edge_serial,
edge_port);
- }
+ // Since we have more credit, check if more
data can be sent
+ send_more_port_data(edge_serial, edge_port);
}
}
position += 2;
@@ -916,10 +914,6 @@
dbg("%s", __FUNCTION__);
- if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
- return;
- }
-
if (urb->status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
urb->status);
}
@@ -969,10 +963,6 @@
/* Free the command urb */
usb_free_urb (urb);
- if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
- return;
- }
-
if (status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__,
status);
return;
@@ -1009,9 +999,6 @@
int response;
int timeout;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL)
@@ -1245,9 +1232,6 @@
struct edgeport_port *edge_port;
int status;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -2071,24 +2055,22 @@
/* spit this data back into the tty driver if this
port is open */
if (rxLen) {
port =
edge_serial->serial->port[edge_serial->rxPort];
- if (port_paranoia_check (port, __FUNCTION__)
== 0) {
- edge_port =
usb_get_serial_port_data(port);
- if (edge_port->open) {
- tty = edge_port->port->tty;
- if (tty) {
- dbg("%s - Sending %d
bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
- for (i = 0; i < rxLen
; ++i) {
- /* if we
insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
-
if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
-
tty_flip_buffer_push(tty);
- }
- /* this
doesn't actually push the data through unless tty->low_latency is set */
-
tty_insert_flip_char(tty, buffer[i], 0);
+ edge_port = usb_get_serial_port_data(port);
+ if (edge_port->open) {
+ tty = edge_port->port->tty;
+ if (tty) {
+ dbg("%s - Sending %d bytes to
TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
+ for (i = 0; i < rxLen ; ++i) {
+ /* if we insert more
than TTY_FLIPBUF_SIZE characters, we drop them. */
+ if(tty->flip.count >=
TTY_FLIPBUF_SIZE) {
+
tty_flip_buffer_push(tty);
}
-
tty_flip_buffer_push(tty);
+ /* this doesn't
actually push the data through unless tty->low_latency is set */
+
tty_insert_flip_char(tty, buffer[i], 0);
}
- edge_port->icount.rx += rxLen;
+ tty_flip_buffer_push(tty);
}
+ edge_port->icount.rx += rxLen;
}
buffer += rxLen;
}
@@ -2124,9 +2106,6 @@
/* switch the port pointer to the one being currently talked about */
port = edge_serial->serial->port[edge_serial->rxPort];
- if (port_paranoia_check (port, __FUNCTION__)) {
- return;
- }
edge_port = usb_get_serial_port_data(port);
if (edge_port == NULL) {
dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for
port %d\n", __FUNCTION__, edge_serial->rxPort);
diff -Nru a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
--- a/drivers/usb/serial/io_ti.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/io_ti.c Fri May 14 15:27:29 2004
@@ -1685,11 +1685,6 @@
dbg ("%s - port_number %d, function %d, info 0x%x",
__FUNCTION__, port_number, function, data[1]);
port = edge_serial->serial->port[port_number];
- if (port_paranoia_check (port, __FUNCTION__)) {
- dbg ("%s - change found for port that is not present",
- __FUNCTION__);
- return;
- }
edge_port = usb_get_serial_port_data(port);
if (!edge_port) {
dbg ("%s - edge_port not found", __FUNCTION__);
@@ -1744,9 +1739,6 @@
dbg("%s", __FUNCTION__);
- if (port_paranoia_check (edge_port->port, __FUNCTION__))
- return;
-
if (urb->status) {
dbg ("%s - nonzero read bulk status received: %d",
__FUNCTION__, urb->status);
@@ -1848,9 +1840,6 @@
u16 open_settings;
u8 transaction_timeout;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL)
@@ -1999,9 +1988,6 @@
int port_number;
int status;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
diff -Nru a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
--- a/drivers/usb/serial/ipaq.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/ipaq.c Fri May 14 15:27:29 2004
@@ -181,10 +181,6 @@
int i, result = 0;
int retries = KP_RETRIES;
- if (port_paranoia_check(port, __FUNCTION__)) {
- return -ENODEV;
- }
-
dbg("%s - port %d", __FUNCTION__, port->number);
bytes_in = 0;
@@ -291,10 +287,6 @@
struct usb_serial *serial;
struct ipaq_private *priv = usb_get_serial_port_data(port);
- if (port_paranoia_check(port, __FUNCTION__)) {
- return;
- }
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial(port, __FUNCTION__);
@@ -323,9 +315,6 @@
unsigned char *data = urb->transfer_buffer;
int i, result;
- if (port_paranoia_check(port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
@@ -488,10 +477,6 @@
unsigned long flags;
int result;
- if (port_paranoia_check (port, __FUNCTION__)) {
- return;
- }
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
diff -Nru a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
--- a/drivers/usb/serial/ir-usb.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/ir-usb.c Fri May 14 15:27:29 2004
@@ -283,9 +283,6 @@
char *buffer;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (buffer_size) {
@@ -330,9 +327,6 @@
{
struct usb_serial *serial;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -411,9 +405,6 @@
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
@@ -437,9 +428,6 @@
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
-
- if (port_paranoia_check (port, __FUNCTION__))
- return;
dbg("%s - port %d", __FUNCTION__, port->number);
diff -Nru a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
--- a/drivers/usb/serial/keyspan_pda.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/keyspan_pda.c Fri May 14 15:27:29 2004
@@ -249,11 +249,6 @@
goto exit;
}
-
- if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
- return;
- }
-
serial = port->serial;
if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
return;
@@ -637,10 +632,6 @@
struct keyspan_pda_private *priv;
priv = usb_get_serial_port_data(port);
-
- if (port_paranoia_check (port, "keyspan_pda_rx_interrupt")) {
- return;
- }
serial = port->serial;
if (serial_paranoia_check (serial, "keyspan_pda_rx_interrupt")) {
diff -Nru a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
--- a/drivers/usb/serial/kobil_sct.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/kobil_sct.c Fri May 14 15:27:29 2004
@@ -230,9 +230,6 @@
priv = usb_get_serial_port_data(port);
priv->line_state = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
// someone sets the dev to 0 if the close method has been called
port->interrupt_in_urb->dev = port->serial->dev;
diff -Nru a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
--- a/drivers/usb/serial/omninet.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/omninet.c Fri May 14 15:27:29 2004
@@ -156,9 +156,6 @@
struct omninet_data *od;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -193,9 +190,6 @@
struct usb_serial_port *wport;
struct omninet_data *od;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -347,11 +341,6 @@
struct usb_serial *serial;
// dbg("omninet_write_bulk_callback, port %0x\n", port);
-
-
- if (port_paranoia_check (port, __FUNCTION__)) {
- return;
- }
serial = port->serial;
if (serial_paranoia_check (serial, __FUNCTION__)) {
diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/pl2303.c Fri May 14 15:27:29 2004
@@ -411,9 +411,6 @@
unsigned char *buf;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
usb_clear_halt(serial->dev, port->write_urb->pipe);
@@ -480,8 +477,6 @@
unsigned int c_cflag;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
serial = get_usb_serial (port, __FUNCTION__);
if (!serial)
return;
@@ -723,9 +718,6 @@
u8 status;
char tty_flag;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
@@ -807,9 +799,6 @@
struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
int result;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) {
diff -Nru a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
--- a/drivers/usb/serial/usb-serial.h Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/usb-serial.h Fri May 14 15:27:29 2004
@@ -1,7 +1,7 @@
/*
* USB Serial Converter driver
*
- * Copyright (C) 1999 - 2003
+ * Copyright (C) 1999 - 2004
* Greg Kroah-Hartman ([EMAIL PROTECTED])
*
* This program is free software; you can redistribute it and/or modify
@@ -309,27 +309,10 @@
return 0;
}
-
-static inline int port_paranoia_check (struct usb_serial_port *port, const char
*function)
-{
- if (!port) {
- dbg("%s - port == NULL", function);
- return -1;
- }
- if (!port->serial) {
- dbg("%s - port->serial == NULL", function);
- return -1;
- }
-
- return 0;
-}
-
-
static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const
char *function)
{
/* if no port was specified, or it fails a paranoia check */
if (!port ||
- port_paranoia_check (port, function) ||
serial_paranoia_check (port->serial, function)) {
/* then say that we don't have a valid usb_serial thing, which will
* end up genrating -ENODEV return values */
diff -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
--- a/drivers/usb/serial/visor.c Fri May 14 15:27:29 2004
+++ b/drivers/usb/serial/visor.c Fri May 14 15:27:29 2004
@@ -396,9 +396,6 @@
struct usb_serial *serial = port->serial;
int result = 0;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (!port->read_urb) {
@@ -449,9 +446,6 @@
struct usb_serial *serial;
unsigned char *transfer_buffer;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
serial = get_usb_serial (port, __FUNCTION__);
@@ -571,9 +565,6 @@
/* free up the transfer buffer, as usb_free_urb() does not do this */
kfree (urb->transfer_buffer);
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status)
@@ -592,9 +583,6 @@
unsigned char *data = urb->transfer_buffer;
int i;
int result;
-
- if (port_paranoia_check (port, __FUNCTION__))
- return;
dbg("%s - port %d", __FUNCTION__, port->number);
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id%62&alloc_ida84&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel