Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0cc8b902
Commit
0cc8b902
authored
May 13, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: remove serial_paranoia_check() function
If this is hiding real problems, we need to find them.
parent
c63063e2
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2 additions
and
72 deletions
+2
-72
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/belkin_sa.c
+0
-6
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cyberjack.c
+0
-5
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/digi_acceleport.c
+0
-5
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_edgeport.c
+0
-8
drivers/usb/serial/io_ti.c
drivers/usb/serial/io_ti.c
+0
-4
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/keyspan_pda.c
+1
-15
drivers/usb/serial/omninet.c
drivers/usb/serial/omninet.c
+0
-6
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.c
+0
-3
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+0
-3
drivers/usb/serial/usb-serial.h
drivers/usb/serial/usb-serial.h
+1
-17
No files found.
drivers/usb/serial/belkin_sa.c
View file @
0cc8b902
...
...
@@ -265,7 +265,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
belkin_sa_private
*
priv
;
struct
usb_serial
*
serial
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
int
retval
;
unsigned
long
flags
;
...
...
@@ -285,11 +284,6 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
goto
exit
;
}
serial
=
port
->
serial
;
if
(
serial_paranoia_check
(
serial
,
__FUNCTION__
))
return
;
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
urb
->
actual_length
,
data
);
/* Handle known interrupt data */
...
...
drivers/usb/serial/cyberjack.c
View file @
0cc8b902
...
...
@@ -318,7 +318,6 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
cyberjack_private
*
priv
=
usb_get_serial_port_data
(
port
);
struct
usb_serial
*
serial
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
int
result
;
...
...
@@ -328,10 +327,6 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
if
(
urb
->
status
)
return
;
serial
=
port
->
serial
;
if
(
serial_paranoia_check
(
serial
,
__FUNCTION__
))
return
;
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
urb
->
actual_length
,
data
);
/* React only to interrupts signaling a bulk_in transfer */
...
...
drivers/usb/serial/digi_acceleport.c
View file @
0cc8b902
...
...
@@ -1396,10 +1396,6 @@ dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status );
return
;
}
/* further sanity checks */
if
(
serial_paranoia_check
(
serial
,
__FUNCTION__
))
return
;
/* try to send any buffered data on this port, if it is open */
spin_lock
(
&
priv
->
dp_port_lock
);
priv
->
dp_write_urb_in_use
=
0
;
...
...
@@ -1797,7 +1793,6 @@ dbg( "digi_read_bulk_callback: TOP" );
return
;
}
if
(
port
->
serial
==
NULL
||
serial_paranoia_check
(
port
->
serial
,
__FUNCTION__
)
||
(
serial_priv
=
usb_get_serial_data
(
port
->
serial
))
==
NULL
)
{
err
(
"%s: serial is bad or serial->private is NULL, status=%d"
,
__FUNCTION__
,
urb
->
status
);
return
;
...
...
drivers/usb/serial/io_edgeport.c
View file @
0cc8b902
...
...
@@ -776,10 +776,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
dbg
(
"%s"
,
__FUNCTION__
);
if
(
serial_paranoia_check
(
edge_serial
->
serial
,
__FUNCTION__
))
{
return
;
}
switch
(
urb
->
status
)
{
case
0
:
/* success */
...
...
@@ -865,10 +861,6 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
dbg
(
"%s"
,
__FUNCTION__
);
if
(
serial_paranoia_check
(
edge_serial
->
serial
,
__FUNCTION__
))
{
return
;
}
if
(
urb
->
status
)
{
dbg
(
"%s - nonzero read bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
return
;
...
...
drivers/usb/serial/io_ti.c
View file @
0cc8b902
...
...
@@ -1649,10 +1649,6 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
dbg
(
"%s"
,
__FUNCTION__
);
if
(
serial_paranoia_check
(
edge_serial
->
serial
,
__FUNCTION__
))
{
return
;
}
switch
(
urb
->
status
)
{
case
0
:
/* success */
...
...
drivers/usb/serial/keyspan_pda.c
View file @
0cc8b902
...
...
@@ -226,8 +226,7 @@ static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
static
void
keyspan_pda_rx_interrupt
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
usb_serial
*
serial
;
struct
tty_struct
*
tty
;
struct
tty_struct
*
tty
=
port
->
tty
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
int
i
;
int
status
;
...
...
@@ -249,17 +248,11 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
goto
exit
;
}
serial
=
port
->
serial
;
if
(
serial_paranoia_check
(
serial
,
"keyspan_pda_rx_interrupt"
))
{
return
;
}
/* see if the message is data or a status interrupt */
switch
(
data
[
0
])
{
case
0
:
/* rest of message is rx data */
if
(
urb
->
actual_length
)
{
tty
=
serial
->
port
[
0
]
->
tty
;
for
(
i
=
1
;
i
<
urb
->
actual_length
;
++
i
)
{
tty_insert_flip_char
(
tty
,
data
[
i
],
0
);
}
...
...
@@ -273,7 +266,6 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
case
1
:
/* modemline change */
break
;
case
2
:
/* tx unthrottle interrupt */
tty
=
serial
->
port
[
0
]
->
tty
;
priv
->
tx_throttled
=
0
;
/* queue up a wakeup at scheduler time */
schedule_work
(
&
priv
->
wakeup_work
);
...
...
@@ -628,16 +620,10 @@ static int keyspan_pda_write(struct usb_serial_port *port, int from_user,
static
void
keyspan_pda_write_bulk_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
usb_serial
*
serial
;
struct
keyspan_pda_private
*
priv
;
priv
=
usb_get_serial_port_data
(
port
);
serial
=
port
->
serial
;
if
(
serial_paranoia_check
(
serial
,
"keyspan_pda_rx_interrupt"
))
{
return
;
}
/* queue up a wakeup at scheduler time */
schedule_work
(
&
priv
->
wakeup_work
);
}
...
...
drivers/usb/serial/omninet.c
View file @
0cc8b902
...
...
@@ -338,15 +338,9 @@ static void omninet_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
{
/* struct omninet_header *header = (struct omninet_header *) urb->transfer_buffer; */
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
usb_serial
*
serial
;
// dbg("omninet_write_bulk_callback, port %0x\n", port);
serial
=
port
->
serial
;
if
(
serial_paranoia_check
(
serial
,
__FUNCTION__
))
{
return
;
}
if
(
urb
->
status
)
{
dbg
(
"%s - nonzero write bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
return
;
...
...
drivers/usb/serial/pl2303.c
View file @
0cc8b902
...
...
@@ -803,9 +803,6 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
if
(
urb
->
status
)
{
/* error in the urb, so we have to resubmit it */
if
(
serial_paranoia_check
(
port
->
serial
,
__FUNCTION__
))
{
return
;
}
dbg
(
"%s - Overflow in write"
,
__FUNCTION__
);
dbg
(
"%s - nonzero write bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
port
->
write_urb
->
transfer_buffer_length
=
1
;
...
...
drivers/usb/serial/usb-serial.c
View file @
0cc8b902
...
...
@@ -460,9 +460,6 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
/* get the serial object associated with this tty pointer */
serial
=
usb_serial_get_by_index
(
tty
->
index
);
if
(
serial_paranoia_check
(
serial
,
__FUNCTION__
))
return
-
ENODEV
;
/* set up our port structure making the tty driver remember our port object, and us it */
portNumber
=
tty
->
index
-
serial
->
minor
;
port
=
serial
->
port
[
portNumber
];
...
...
drivers/usb/serial/usb-serial.h
View file @
0cc8b902
...
...
@@ -294,26 +294,10 @@ extern struct usb_serial_device_type usb_serial_generic_device;
extern
struct
bus_type
usb_serial_bus_type
;
extern
struct
tty_driver
*
usb_serial_tty_driver
;
/* Inline functions to check the sanity of a pointer that is passed to us */
static
inline
int
serial_paranoia_check
(
struct
usb_serial
*
serial
,
const
char
*
function
)
{
if
(
!
serial
)
{
dbg
(
"%s - serial == NULL"
,
function
);
return
-
1
;
}
if
(
!
serial
->
type
)
{
dbg
(
"%s - serial->type == 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
||
serial_paranoia_check
(
port
->
serial
,
function
))
{
if
(
!
port
)
{
/* then say that we don't have a valid usb_serial thing, which will
* end up genrating -ENODEV return values */
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment