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
nexedi
linux
Commits
52db091e
Commit
52db091e
authored
Jul 14, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: more sparse cleanups (all pretty much NULL usages.)
Signed-off-by:
Greg Kroah-Hartman
<
greg@kroah.com
>
parent
213aaf83
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
95 additions
and
90 deletions
+95
-90
drivers/usb/class/usb-midi.c
drivers/usb/class/usb-midi.c
+8
-8
drivers/usb/host/ehci-dbg.c
drivers/usb/host/ehci-dbg.c
+1
-1
drivers/usb/host/ehci-sched.c
drivers/usb/host/ehci-sched.c
+6
-6
drivers/usb/host/ohci-dbg.c
drivers/usb/host/ohci-dbg.c
+3
-3
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hcd.c
+5
-5
drivers/usb/host/ohci-hub.c
drivers/usb/host/ohci-hub.c
+3
-3
drivers/usb/host/ohci-mem.c
drivers/usb/host/ohci-mem.c
+3
-3
drivers/usb/host/ohci-q.c
drivers/usb/host/ohci-q.c
+7
-7
drivers/usb/image/mdc800.c
drivers/usb/image/mdc800.c
+11
-13
drivers/usb/image/microtek.c
drivers/usb/image/microtek.c
+1
-1
drivers/usb/input/aiptek.c
drivers/usb/input/aiptek.c
+5
-5
drivers/usb/input/hid-core.c
drivers/usb/input/hid-core.c
+8
-2
drivers/usb/input/powermate.c
drivers/usb/input/powermate.c
+1
-1
drivers/usb/media/ov511.c
drivers/usb/media/ov511.c
+1
-1
drivers/usb/media/pwc-ctrl.c
drivers/usb/media/pwc-ctrl.c
+1
-1
drivers/usb/media/pwc-if.c
drivers/usb/media/pwc-if.c
+2
-1
drivers/usb/misc/auerswald.c
drivers/usb/misc/auerswald.c
+1
-1
drivers/usb/misc/speedtch.c
drivers/usb/misc/speedtch.c
+1
-1
drivers/usb/misc/usbtest.c
drivers/usb/misc/usbtest.c
+12
-12
drivers/usb/net/kaweth.c
drivers/usb/net/kaweth.c
+1
-1
drivers/usb/net/usbnet.c
drivers/usb/net/usbnet.c
+13
-13
drivers/usb/storage/sddr09.c
drivers/usb/storage/sddr09.c
+1
-1
No files found.
drivers/usb/class/usb-midi.c
View file @
52db091e
...
@@ -951,7 +951,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
...
@@ -951,7 +951,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
if
(
m
->
open_mode
&
FMODE_READ
)
{
if
(
m
->
open_mode
&
FMODE_READ
)
{
unsigned
long
int
flagsep
;
unsigned
long
int
flagsep
;
spin_lock_irqsave
(
&
m
->
min
.
ep
->
lock
,
flagsep
);
spin_lock_irqsave
(
&
m
->
min
.
ep
->
lock
,
flagsep
);
m
->
min
.
ep
->
cables
[
m
->
min
.
cableId
]
=
0
;
// discard cable
m
->
min
.
ep
->
cables
[
m
->
min
.
cableId
]
=
NULL
;
// discard cable
m
->
min
.
ep
->
readers
-=
1
;
m
->
min
.
ep
->
readers
-=
1
;
m
->
open_mode
&=
~
FMODE_READ
;
m
->
open_mode
&=
~
FMODE_READ
;
if
(
m
->
min
.
ep
->
readers
==
0
&&
if
(
m
->
min
.
ep
->
readers
==
0
&&
...
@@ -967,7 +967,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
...
@@ -967,7 +967,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
up
(
&
open_sem
);
up
(
&
open_sem
);
wake_up
(
&
open_wait
);
wake_up
(
&
open_wait
);
file
->
private_data
=
0
;
file
->
private_data
=
NULL
;
return
0
;
return
0
;
}
}
...
@@ -1294,7 +1294,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
...
@@ -1294,7 +1294,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
unsigned
char
jack2string
[
256
];
unsigned
char
jack2string
[
256
];
#endif
#endif
u
=
0
;
u
=
NULL
;
/* find audiocontrol interface */
/* find audiocontrol interface */
p1
=
find_csinterface_descriptor
(
buffer
,
bufSize
,
NULL
,
p1
=
find_csinterface_descriptor
(
buffer
,
bufSize
,
NULL
,
MS_HEADER
,
ifnum
,
altSetting
);
MS_HEADER
,
ifnum
,
altSetting
);
...
@@ -1314,7 +1314,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
...
@@ -1314,7 +1314,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
if
(
!
u
)
{
if
(
!
u
)
{
return
NULL
;
return
NULL
;
}
}
u
->
deviceName
=
0
;
u
->
deviceName
=
NULL
;
u
->
idVendor
=
d
->
descriptor
.
idVendor
;
u
->
idVendor
=
d
->
descriptor
.
idVendor
;
u
->
idProduct
=
d
->
descriptor
.
idProduct
;
u
->
idProduct
=
d
->
descriptor
.
idProduct
;
u
->
interface
=
ifnum
;
u
->
interface
=
ifnum
;
...
@@ -1388,7 +1388,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
...
@@ -1388,7 +1388,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
if
(
quirks
==
0
)
{
if
(
quirks
==
0
)
{
/* MIDISTREAM */
/* MIDISTREAM */
p2
=
0
;
p2
=
NULL
;
for
(
p1
=
find_descriptor
(
buffer
,
bufSize
,
NULL
,
USB_DT_ENDPOINT
,
for
(
p1
=
find_descriptor
(
buffer
,
bufSize
,
NULL
,
USB_DT_ENDPOINT
,
ifnum
,
altSetting
);
p1
;
p1
=
next
)
{
ifnum
,
altSetting
);
p1
;
p1
=
next
)
{
next
=
find_descriptor
(
buffer
,
bufSize
,
p1
,
USB_DT_ENDPOINT
,
next
=
find_descriptor
(
buffer
,
bufSize
,
p1
,
USB_DT_ENDPOINT
,
...
@@ -1397,7 +1397,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
...
@@ -1397,7 +1397,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
ifnum
,
altSetting
);
ifnum
,
altSetting
);
if
(
p2
&&
next
&&
(
p2
>
next
)
)
if
(
p2
&&
next
&&
(
p2
>
next
)
)
p2
=
0
;
p2
=
NULL
;
if
(
p1
[
0
]
<
9
||
!
p2
||
p2
[
0
]
<
4
)
if
(
p1
[
0
]
<
9
||
!
p2
||
p2
[
0
]
<
4
)
continue
;
continue
;
...
@@ -1940,8 +1940,8 @@ static int detect_by_hand(struct usb_device *d, unsigned int ifnum, struct usb_m
...
@@ -1940,8 +1940,8 @@ static int detect_by_hand(struct usb_device *d, unsigned int ifnum, struct usb_m
if
(
ucable
<
0
||
ucable
>
15
)
if
(
ucable
<
0
||
ucable
>
15
)
ucable
=
0
;
ucable
=
0
;
u
.
deviceName
=
0
;
/* A flag for alloc_usb_midi_device to get device name
u
.
deviceName
=
NULL
;
/* A flag for alloc_usb_midi_device to get device name
from device. */
from device. */
u
.
idVendor
=
uvendor
;
u
.
idVendor
=
uvendor
;
u
.
idProduct
=
uproduct
;
u
.
idProduct
=
uproduct
;
u
.
interface
=
uinterface
;
u
.
interface
=
uinterface
;
...
...
drivers/usb/host/ehci-dbg.c
View file @
52db091e
...
@@ -536,7 +536,7 @@ show_periodic (struct class_device *class_dev, char *buf)
...
@@ -536,7 +536,7 @@ show_periodic (struct class_device *class_dev, char *buf)
if
(
p
.
qh
->
qh_next
.
ptr
)
if
(
p
.
qh
->
qh_next
.
ptr
)
temp
=
scnprintf
(
next
,
size
,
temp
=
scnprintf
(
next
,
size
,
" ..."
);
" ..."
);
p
.
ptr
=
0
;
p
.
ptr
=
NULL
;
break
;
break
;
}
}
/* show more info the first time around */
/* show more info the first time around */
...
...
drivers/usb/host/ehci-sched.c
View file @
52db091e
...
@@ -1499,7 +1499,7 @@ sitd_urb_transaction (
...
@@ -1499,7 +1499,7 @@ sitd_urb_transaction (
list_del
(
&
sitd
->
sitd_list
);
list_del
(
&
sitd
->
sitd_list
);
sitd_dma
=
sitd
->
sitd_dma
;
sitd_dma
=
sitd
->
sitd_dma
;
}
else
}
else
sitd
=
0
;
sitd
=
NULL
;
if
(
!
sitd
)
{
if
(
!
sitd
)
{
spin_unlock_irqrestore
(
&
ehci
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
ehci
->
lock
,
flags
);
...
@@ -1600,7 +1600,7 @@ sitd_link_urb (
...
@@ -1600,7 +1600,7 @@ sitd_link_urb (
hcd_to_bus
(
&
ehci
->
hcd
)
->
bandwidth_isoc_reqs
++
;
hcd_to_bus
(
&
ehci
->
hcd
)
->
bandwidth_isoc_reqs
++
;
/* fill sITDs frame by frame */
/* fill sITDs frame by frame */
for
(
packet
=
0
,
sitd
=
0
;
for
(
packet
=
0
,
sitd
=
NULL
;
packet
<
urb
->
number_of_packets
;
packet
<
urb
->
number_of_packets
;
packet
++
)
{
packet
++
)
{
...
@@ -1626,7 +1626,7 @@ sitd_link_urb (
...
@@ -1626,7 +1626,7 @@ sitd_link_urb (
/* don't need that schedule data any more */
/* don't need that schedule data any more */
iso_sched_free
(
stream
,
sched
);
iso_sched_free
(
stream
,
sched
);
urb
->
hcpriv
=
0
;
urb
->
hcpriv
=
NULL
;
timer_action
(
ehci
,
TIMER_IO_WATCHDOG
);
timer_action
(
ehci
,
TIMER_IO_WATCHDOG
);
if
(
!
ehci
->
periodic_sched
++
)
if
(
!
ehci
->
periodic_sched
++
)
...
@@ -1673,8 +1673,8 @@ sitd_complete (
...
@@ -1673,8 +1673,8 @@ sitd_complete (
}
}
usb_put_urb
(
urb
);
usb_put_urb
(
urb
);
sitd
->
urb
=
0
;
sitd
->
urb
=
NULL
;
sitd
->
stream
=
0
;
sitd
->
stream
=
NULL
;
list_move
(
&
sitd
->
sitd_list
,
&
stream
->
free_list
);
list_move
(
&
sitd
->
sitd_list
,
&
stream
->
free_list
);
stream
->
depth
-=
stream
->
interval
<<
3
;
stream
->
depth
-=
stream
->
interval
<<
3
;
iso_stream_put
(
ehci
,
stream
);
iso_stream_put
(
ehci
,
stream
);
...
@@ -1691,7 +1691,7 @@ sitd_complete (
...
@@ -1691,7 +1691,7 @@ sitd_complete (
/* give urb back to the driver */
/* give urb back to the driver */
dev
=
usb_get_dev
(
urb
->
dev
);
dev
=
usb_get_dev
(
urb
->
dev
);
ehci_urb_done
(
ehci
,
urb
,
regs
);
ehci_urb_done
(
ehci
,
urb
,
regs
);
urb
=
0
;
urb
=
NULL
;
/* defer stopping schedule; completion can submit */
/* defer stopping schedule; completion can submit */
ehci
->
periodic_sched
--
;
ehci
->
periodic_sched
--
;
...
...
drivers/usb/host/ohci-dbg.c
View file @
52db091e
...
@@ -266,11 +266,11 @@ static void ohci_dump (struct ohci_hcd *controller, int verbose)
...
@@ -266,11 +266,11 @@ static void ohci_dump (struct ohci_hcd *controller, int verbose)
ohci_dbg
(
controller
,
"OHCI controller state
\n
"
);
ohci_dbg
(
controller
,
"OHCI controller state
\n
"
);
// dumps some of the state we know about
// dumps some of the state we know about
ohci_dump_status
(
controller
,
NULL
,
0
);
ohci_dump_status
(
controller
,
NULL
,
NULL
);
if
(
controller
->
hcca
)
if
(
controller
->
hcca
)
ohci_dbg
(
controller
,
ohci_dbg
(
controller
,
"hcca frame #%04x
\n
"
,
OHCI_FRAME_NO
(
controller
->
hcca
));
"hcca frame #%04x
\n
"
,
OHCI_FRAME_NO
(
controller
->
hcca
));
ohci_dump_roothub
(
controller
,
1
,
NULL
,
0
);
ohci_dump_roothub
(
controller
,
1
,
NULL
,
NULL
);
}
}
static
const
char
data0
[]
=
"DATA0"
;
static
const
char
data0
[]
=
"DATA0"
;
...
@@ -574,7 +574,7 @@ show_periodic (struct class_device *class_dev, char *buf)
...
@@ -574,7 +574,7 @@ show_periodic (struct class_device *class_dev, char *buf)
}
else
{
}
else
{
/* we've seen it and what's after */
/* we've seen it and what's after */
temp
=
0
;
temp
=
0
;
ed
=
0
;
ed
=
NULL
;
}
}
}
while
(
ed
);
}
while
(
ed
);
...
...
drivers/usb/host/ohci-hcd.c
View file @
52db091e
...
@@ -229,7 +229,7 @@ static int ohci_urb_enqueue (
...
@@ -229,7 +229,7 @@ static int ohci_urb_enqueue (
if
(
urb
->
status
!=
-
EINPROGRESS
)
{
if
(
urb
->
status
!=
-
EINPROGRESS
)
{
spin_unlock
(
&
urb
->
lock
);
spin_unlock
(
&
urb
->
lock
);
urb
->
hcpriv
=
urb_priv
;
urb
->
hcpriv
=
urb_priv
;
finish_urb
(
ohci
,
urb
,
0
);
finish_urb
(
ohci
,
urb
,
NULL
);
retval
=
0
;
retval
=
0
;
goto
fail
;
goto
fail
;
}
}
...
@@ -341,7 +341,7 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
...
@@ -341,7 +341,7 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
if
(
!
HCD_IS_RUNNING
(
ohci
->
hcd
.
state
))
{
if
(
!
HCD_IS_RUNNING
(
ohci
->
hcd
.
state
))
{
ed
->
state
=
ED_IDLE
;
ed
->
state
=
ED_IDLE
;
finish_unlinks
(
ohci
,
0
,
0
);
finish_unlinks
(
ohci
,
0
,
NULL
);
}
}
switch
(
ed
->
state
)
{
switch
(
ed
->
state
)
{
...
@@ -369,7 +369,7 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
...
@@ -369,7 +369,7 @@ ohci_endpoint_disable (struct usb_hcd *hcd, struct hcd_dev *dev, int ep)
td_free
(
ohci
,
ed
->
dummy
);
td_free
(
ohci
,
ed
->
dummy
);
break
;
break
;
}
}
dev
->
ep
[
epnum
]
=
0
;
dev
->
ep
[
epnum
]
=
NULL
;
done:
done:
spin_unlock_irqrestore
(
&
ohci
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
ohci
->
lock
,
flags
);
return
;
return
;
...
@@ -728,7 +728,7 @@ static int hc_restart (struct ohci_hcd *ohci)
...
@@ -728,7 +728,7 @@ static int hc_restart (struct ohci_hcd *ohci)
ed_deschedule
(
ohci
,
ed
);
ed_deschedule
(
ohci
,
ed
);
ed
->
ed_next
=
ohci
->
ed_rm_list
;
ed
->
ed_next
=
ohci
->
ed_rm_list
;
ed
->
ed_prev
=
0
;
ed
->
ed_prev
=
NULL
;
ohci
->
ed_rm_list
=
ed
;
ohci
->
ed_rm_list
=
ed
;
/* FALLTHROUGH */
/* FALLTHROUGH */
case
ED_UNLINK
:
case
ED_UNLINK
:
...
@@ -742,7 +742,7 @@ static int hc_restart (struct ohci_hcd *ohci)
...
@@ -742,7 +742,7 @@ static int hc_restart (struct ohci_hcd *ohci)
urb
->
status
=
-
ESHUTDOWN
;
urb
->
status
=
-
ESHUTDOWN
;
spin_unlock
(
&
urb
->
lock
);
spin_unlock
(
&
urb
->
lock
);
}
}
finish_unlinks
(
ohci
,
0
,
0
);
finish_unlinks
(
ohci
,
0
,
NULL
);
spin_unlock_irq
(
&
ohci
->
lock
);
spin_unlock_irq
(
&
ohci
->
lock
);
/* paranoia, in case that didn't work: */
/* paranoia, in case that didn't work: */
...
...
drivers/usb/host/ohci-hub.c
View file @
52db091e
...
@@ -123,11 +123,11 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
...
@@ -123,11 +123,11 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
if
(
ohci_readl
(
&
ohci
->
regs
->
intrstatus
)
&
OHCI_INTR_SF
)
if
(
ohci_readl
(
&
ohci
->
regs
->
intrstatus
)
&
OHCI_INTR_SF
)
break
;
break
;
}
}
dl_done_list
(
ohci
,
0
);
dl_done_list
(
ohci
,
NULL
);
mdelay
(
7
);
mdelay
(
7
);
}
}
dl_done_list
(
ohci
,
0
);
dl_done_list
(
ohci
,
NULL
);
finish_unlinks
(
ohci
,
OHCI_FRAME_NO
(
ohci
->
hcca
),
0
);
finish_unlinks
(
ohci
,
OHCI_FRAME_NO
(
ohci
->
hcca
),
NULL
);
writel
(
ohci_readl
(
&
ohci
->
regs
->
intrstatus
),
&
ohci
->
regs
->
intrstatus
);
writel
(
ohci_readl
(
&
ohci
->
regs
->
intrstatus
),
&
ohci
->
regs
->
intrstatus
);
/* maybe resume can wake root hub */
/* maybe resume can wake root hub */
...
...
drivers/usb/host/ohci-mem.c
View file @
52db091e
...
@@ -36,7 +36,7 @@ static struct usb_hcd *ohci_hcd_alloc (void)
...
@@ -36,7 +36,7 @@ static struct usb_hcd *ohci_hcd_alloc (void)
INIT_WORK
(
&
ohci
->
rh_resume
,
ohci_rh_resume
,
&
ohci
->
hcd
);
INIT_WORK
(
&
ohci
->
rh_resume
,
ohci_rh_resume
,
&
ohci
->
hcd
);
return
&
ohci
->
hcd
;
return
&
ohci
->
hcd
;
}
}
return
0
;
return
NULL
;
}
}
static
void
ohci_hcd_free
(
struct
usb_hcd
*
hcd
)
static
void
ohci_hcd_free
(
struct
usb_hcd
*
hcd
)
...
@@ -69,11 +69,11 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
...
@@ -69,11 +69,11 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
{
{
if
(
ohci
->
td_cache
)
{
if
(
ohci
->
td_cache
)
{
dma_pool_destroy
(
ohci
->
td_cache
);
dma_pool_destroy
(
ohci
->
td_cache
);
ohci
->
td_cache
=
0
;
ohci
->
td_cache
=
NULL
;
}
}
if
(
ohci
->
ed_cache
)
{
if
(
ohci
->
ed_cache
)
{
dma_pool_destroy
(
ohci
->
ed_cache
);
dma_pool_destroy
(
ohci
->
ed_cache
);
ohci
->
ed_cache
=
0
;
ohci
->
ed_cache
=
NULL
;
}
}
}
}
...
...
drivers/usb/host/ohci-q.c
View file @
52db091e
...
@@ -174,8 +174,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
...
@@ -174,8 +174,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
return
-
EAGAIN
;
return
-
EAGAIN
;
ed
->
state
=
ED_OPER
;
ed
->
state
=
ED_OPER
;
ed
->
ed_prev
=
0
;
ed
->
ed_prev
=
NULL
;
ed
->
ed_next
=
0
;
ed
->
ed_next
=
NULL
;
ed
->
hwNextED
=
0
;
ed
->
hwNextED
=
0
;
wmb
();
wmb
();
...
@@ -333,7 +333,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
...
@@ -333,7 +333,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
if
(
ohci
->
ed_controltail
==
ed
)
{
if
(
ohci
->
ed_controltail
==
ed
)
{
ohci
->
ed_controltail
=
ed
->
ed_prev
;
ohci
->
ed_controltail
=
ed
->
ed_prev
;
if
(
ohci
->
ed_controltail
)
if
(
ohci
->
ed_controltail
)
ohci
->
ed_controltail
->
ed_next
=
0
;
ohci
->
ed_controltail
->
ed_next
=
NULL
;
}
else
if
(
ed
->
ed_next
)
{
}
else
if
(
ed
->
ed_next
)
{
ed
->
ed_next
->
ed_prev
=
ed
->
ed_prev
;
ed
->
ed_next
->
ed_prev
=
ed
->
ed_prev
;
}
}
...
@@ -357,7 +357,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
...
@@ -357,7 +357,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
if
(
ohci
->
ed_bulktail
==
ed
)
{
if
(
ohci
->
ed_bulktail
==
ed
)
{
ohci
->
ed_bulktail
=
ed
->
ed_prev
;
ohci
->
ed_bulktail
=
ed
->
ed_prev
;
if
(
ohci
->
ed_bulktail
)
if
(
ohci
->
ed_bulktail
)
ohci
->
ed_bulktail
->
ed_next
=
0
;
ohci
->
ed_bulktail
->
ed_next
=
NULL
;
}
else
if
(
ed
->
ed_next
)
{
}
else
if
(
ed
->
ed_next
)
{
ed
->
ed_next
->
ed_prev
=
ed
->
ed_prev
;
ed
->
ed_next
->
ed_prev
=
ed
->
ed_prev
;
}
}
...
@@ -412,7 +412,7 @@ static struct ed *ed_get (
...
@@ -412,7 +412,7 @@ static struct ed *ed_get (
if
(
!
td
)
{
if
(
!
td
)
{
/* out of memory */
/* out of memory */
ed_free
(
ohci
,
ed
);
ed_free
(
ohci
,
ed
);
ed
=
0
;
ed
=
NULL
;
goto
done
;
goto
done
;
}
}
ed
->
dummy
=
td
;
ed
->
dummy
=
td
;
...
@@ -474,7 +474,7 @@ static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed)
...
@@ -474,7 +474,7 @@ static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed)
/* rm_list is just singly linked, for simplicity */
/* rm_list is just singly linked, for simplicity */
ed
->
ed_next
=
ohci
->
ed_rm_list
;
ed
->
ed_next
=
ohci
->
ed_rm_list
;
ed
->
ed_prev
=
0
;
ed
->
ed_prev
=
NULL
;
ohci
->
ed_rm_list
=
ed
;
ohci
->
ed_rm_list
=
ed
;
/* enable SOF interrupt */
/* enable SOF interrupt */
...
@@ -950,7 +950,7 @@ finish_unlinks (struct ohci_hcd *ohci, u16 tick, struct pt_regs *regs)
...
@@ -950,7 +950,7 @@ finish_unlinks (struct ohci_hcd *ohci, u16 tick, struct pt_regs *regs)
* entries (which we'd ignore), but paranoia won't hurt.
* entries (which we'd ignore), but paranoia won't hurt.
*/
*/
*
last
=
ed
->
ed_next
;
*
last
=
ed
->
ed_next
;
ed
->
ed_next
=
0
;
ed
->
ed_next
=
NULL
;
modified
=
0
;
modified
=
0
;
/* unlink urbs as requested, but rescan the list after
/* unlink urbs as requested, but rescan the list after
...
...
drivers/usb/image/mdc800.c
View file @
52db091e
...
@@ -190,7 +190,7 @@ static struct usb_endpoint_descriptor mdc800_ed [4] =
...
@@ -190,7 +190,7 @@ static struct usb_endpoint_descriptor mdc800_ed [4] =
/* The Variable used by the driver */
/* The Variable used by the driver */
static
struct
mdc800_data
*
mdc800
=
0
;
static
struct
mdc800_data
*
mdc800
;
/***************************************************************************
/***************************************************************************
...
@@ -547,7 +547,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
...
@@ -547,7 +547,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
usb_unlink_urb
(
mdc800
->
write_urb
);
usb_unlink_urb
(
mdc800
->
write_urb
);
usb_unlink_urb
(
mdc800
->
download_urb
);
usb_unlink_urb
(
mdc800
->
download_urb
);
mdc800
->
dev
=
0
;
mdc800
->
dev
=
NULL
;
usb_set_intfdata
(
intf
,
NULL
);
usb_set_intfdata
(
intf
,
NULL
);
}
}
info
(
"Mustek MDC800 disconnected from USB."
);
info
(
"Mustek MDC800 disconnected from USB."
);
...
@@ -972,8 +972,6 @@ static struct usb_driver mdc800_usb_driver =
...
@@ -972,8 +972,6 @@ static struct usb_driver mdc800_usb_driver =
*************************************************************************/
*************************************************************************/
#define try(A) if ((A) == 0) goto cleanup_on_fail;
#define try(A) if ((A) == 0) goto cleanup_on_fail;
#define try_free_mem(A) if (A != 0) { kfree (A); A=0; }
#define try_free_urb(A) if (A != 0) { usb_free_urb (A); A=0; }
static
int
__init
usb_mdc800_init
(
void
)
static
int
__init
usb_mdc800_init
(
void
)
{
{
...
@@ -982,7 +980,7 @@ static int __init usb_mdc800_init (void)
...
@@ -982,7 +980,7 @@ static int __init usb_mdc800_init (void)
try
(
mdc800
=
kmalloc
(
sizeof
(
struct
mdc800_data
),
GFP_KERNEL
));
try
(
mdc800
=
kmalloc
(
sizeof
(
struct
mdc800_data
),
GFP_KERNEL
));
memset
(
mdc800
,
0
,
sizeof
(
struct
mdc800_data
));
memset
(
mdc800
,
0
,
sizeof
(
struct
mdc800_data
));
mdc800
->
dev
=
0
;
mdc800
->
dev
=
NULL
;
mdc800
->
open
=
0
;
mdc800
->
open
=
0
;
mdc800
->
state
=
NOT_CONNECTED
;
mdc800
->
state
=
NOT_CONNECTED
;
init_MUTEX
(
&
mdc800
->
io_lock
);
init_MUTEX
(
&
mdc800
->
io_lock
);
...
@@ -1020,17 +1018,17 @@ static int __init usb_mdc800_init (void)
...
@@ -1020,17 +1018,17 @@ static int __init usb_mdc800_init (void)
{
{
err
(
"can't alloc memory!"
);
err
(
"can't alloc memory!"
);
try_free_mem
(
mdc800
->
download_urb_buffer
);
kfree
(
mdc800
->
download_urb_buffer
);
try_free_mem
(
mdc800
->
write_urb_buffer
);
kfree
(
mdc800
->
write_urb_buffer
);
try_free_mem
(
mdc800
->
irq_urb_buffer
);
kfree
(
mdc800
->
irq_urb_buffer
);
try_free_urb
(
mdc800
->
write_urb
);
usb_free_urb
(
mdc800
->
write_urb
);
try_free_urb
(
mdc800
->
download_urb
);
usb_free_urb
(
mdc800
->
download_urb
);
try_free_urb
(
mdc800
->
irq_urb
);
usb_free_urb
(
mdc800
->
irq_urb
);
kfree
(
mdc800
);
kfree
(
mdc800
);
}
}
mdc800
=
0
;
mdc800
=
NULL
;
return
retval
;
return
retval
;
}
}
...
@@ -1048,7 +1046,7 @@ static void __exit usb_mdc800_cleanup (void)
...
@@ -1048,7 +1046,7 @@ static void __exit usb_mdc800_cleanup (void)
kfree
(
mdc800
->
download_urb_buffer
);
kfree
(
mdc800
->
download_urb_buffer
);
kfree
(
mdc800
);
kfree
(
mdc800
);
mdc800
=
0
;
mdc800
=
NULL
;
}
}
module_init
(
usb_mdc800_init
);
module_init
(
usb_mdc800_init
);
...
...
drivers/usb/image/microtek.c
View file @
52db091e
...
@@ -534,7 +534,7 @@ mts_build_transfer_context( Scsi_Cmnd *srb, struct mts_desc* desc )
...
@@ -534,7 +534,7 @@ mts_build_transfer_context( Scsi_Cmnd *srb, struct mts_desc* desc )
if
(
!
srb
->
use_sg
)
{
if
(
!
srb
->
use_sg
)
{
if
(
!
srb
->
bufflen
){
if
(
!
srb
->
bufflen
){
desc
->
context
.
data
=
0
;
desc
->
context
.
data
=
NULL
;
desc
->
context
.
data_length
=
0
;
desc
->
context
.
data_length
=
0
;
return
;
return
;
}
else
{
}
else
{
...
...
drivers/usb/input/aiptek.c
View file @
52db091e
...
@@ -1324,7 +1324,7 @@ store_tabletXtilt(struct device *dev, const char *buf, size_t count)
...
@@ -1324,7 +1324,7 @@ store_tabletXtilt(struct device *dev, const char *buf, size_t count)
if
(
strcmp
(
buf
,
"disable"
)
==
0
)
{
if
(
strcmp
(
buf
,
"disable"
)
==
0
)
{
aiptek
->
newSetting
.
xTilt
=
AIPTEK_TILT_DISABLE
;
aiptek
->
newSetting
.
xTilt
=
AIPTEK_TILT_DISABLE
;
}
else
{
}
else
{
x
=
(
int
)
simple_strtol
(
buf
,
0
,
10
);
x
=
(
int
)
simple_strtol
(
buf
,
NULL
,
10
);
if
(
x
>=
AIPTEK_TILT_MIN
&&
x
<=
AIPTEK_TILT_MAX
)
{
if
(
x
>=
AIPTEK_TILT_MIN
&&
x
<=
AIPTEK_TILT_MAX
)
{
aiptek
->
newSetting
.
xTilt
=
x
;
aiptek
->
newSetting
.
xTilt
=
x
;
}
}
...
@@ -1366,7 +1366,7 @@ store_tabletYtilt(struct device *dev, const char *buf, size_t count)
...
@@ -1366,7 +1366,7 @@ store_tabletYtilt(struct device *dev, const char *buf, size_t count)
if
(
strcmp
(
buf
,
"disable"
)
==
0
)
{
if
(
strcmp
(
buf
,
"disable"
)
==
0
)
{
aiptek
->
newSetting
.
yTilt
=
AIPTEK_TILT_DISABLE
;
aiptek
->
newSetting
.
yTilt
=
AIPTEK_TILT_DISABLE
;
}
else
{
}
else
{
y
=
(
int
)
simple_strtol
(
buf
,
0
,
10
);
y
=
(
int
)
simple_strtol
(
buf
,
NULL
,
10
);
if
(
y
>=
AIPTEK_TILT_MIN
&&
y
<=
AIPTEK_TILT_MAX
)
{
if
(
y
>=
AIPTEK_TILT_MIN
&&
y
<=
AIPTEK_TILT_MAX
)
{
aiptek
->
newSetting
.
yTilt
=
y
;
aiptek
->
newSetting
.
yTilt
=
y
;
}
}
...
@@ -1399,7 +1399,7 @@ store_tabletJitterDelay(struct device *dev, const char *buf, size_t count)
...
@@ -1399,7 +1399,7 @@ store_tabletJitterDelay(struct device *dev, const char *buf, size_t count)
if
(
aiptek
==
NULL
)
if
(
aiptek
==
NULL
)
return
0
;
return
0
;
aiptek
->
newSetting
.
jitterDelay
=
(
int
)
simple_strtol
(
buf
,
0
,
10
);
aiptek
->
newSetting
.
jitterDelay
=
(
int
)
simple_strtol
(
buf
,
NULL
,
10
);
return
count
;
return
count
;
}
}
...
@@ -1430,7 +1430,7 @@ store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count)
...
@@ -1430,7 +1430,7 @@ store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count)
if
(
aiptek
==
NULL
)
if
(
aiptek
==
NULL
)
return
0
;
return
0
;
aiptek
->
newSetting
.
programmableDelay
=
(
int
)
simple_strtol
(
buf
,
0
,
10
);
aiptek
->
newSetting
.
programmableDelay
=
(
int
)
simple_strtol
(
buf
,
NULL
,
10
);
return
count
;
return
count
;
}
}
...
@@ -1805,7 +1805,7 @@ store_tabletWheel(struct device *dev, const char *buf, size_t count)
...
@@ -1805,7 +1805,7 @@ store_tabletWheel(struct device *dev, const char *buf, size_t count)
if
(
aiptek
==
NULL
)
if
(
aiptek
==
NULL
)
return
0
;
return
0
;
aiptek
->
newSetting
.
wheel
=
(
int
)
simple_strtol
(
buf
,
0
,
10
);
aiptek
->
newSetting
.
wheel
=
(
int
)
simple_strtol
(
buf
,
NULL
,
10
);
return
count
;
return
count
;
}
}
...
...
drivers/usb/input/hid-core.c
View file @
52db091e
...
@@ -807,7 +807,11 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
...
@@ -807,7 +807,11 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
unsigned
size
=
field
->
report_size
;
unsigned
size
=
field
->
report_size
;
__s32
min
=
field
->
logical_minimum
;
__s32
min
=
field
->
logical_minimum
;
__s32
max
=
field
->
logical_maximum
;
__s32
max
=
field
->
logical_maximum
;
__s32
value
[
count
];
/* WARNING: gcc specific */
__s32
*
value
;
value
=
kmalloc
(
sizeof
(
__s32
)
*
count
,
GFP_ATOMIC
);
if
(
!
value
)
return
;
for
(
n
=
0
;
n
<
count
;
n
++
)
{
for
(
n
=
0
;
n
<
count
;
n
++
)
{
...
@@ -817,7 +821,7 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
...
@@ -817,7 +821,7 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
if
(
!
(
field
->
flags
&
HID_MAIN_ITEM_VARIABLE
)
/* Ignore report if ErrorRollOver */
if
(
!
(
field
->
flags
&
HID_MAIN_ITEM_VARIABLE
)
/* Ignore report if ErrorRollOver */
&&
value
[
n
]
>=
min
&&
value
[
n
]
<=
max
&&
value
[
n
]
>=
min
&&
value
[
n
]
<=
max
&&
field
->
usage
[
value
[
n
]
-
min
].
hid
==
HID_UP_KEYBOARD
+
1
)
&&
field
->
usage
[
value
[
n
]
-
min
].
hid
==
HID_UP_KEYBOARD
+
1
)
return
;
goto
exit
;
}
}
for
(
n
=
0
;
n
<
count
;
n
++
)
{
for
(
n
=
0
;
n
<
count
;
n
++
)
{
...
@@ -847,6 +851,8 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
...
@@ -847,6 +851,8 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
}
}
memcpy
(
field
->
value
,
value
,
count
*
sizeof
(
__s32
));
memcpy
(
field
->
value
,
value
,
count
*
sizeof
(
__s32
));
exit:
kfree
(
value
);
}
}
static
int
hid_input_report
(
int
type
,
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
static
int
hid_input_report
(
int
type
,
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
...
...
drivers/usb/input/powermate.c
View file @
52db091e
...
@@ -182,7 +182,7 @@ static void powermate_sync_state(struct powermate_device *pm)
...
@@ -182,7 +182,7 @@ static void powermate_sync_state(struct powermate_device *pm)
pm
->
configcr
->
wLength
=
0
;
pm
->
configcr
->
wLength
=
0
;
usb_fill_control_urb
(
pm
->
config
,
pm
->
udev
,
usb_sndctrlpipe
(
pm
->
udev
,
0
),
usb_fill_control_urb
(
pm
->
config
,
pm
->
udev
,
usb_sndctrlpipe
(
pm
->
udev
,
0
),
(
void
*
)
pm
->
configcr
,
0
,
0
,
(
void
*
)
pm
->
configcr
,
NULL
,
0
,
powermate_config_complete
,
pm
);
powermate_config_complete
,
pm
);
pm
->
config
->
setup_dma
=
pm
->
configcr_dma
;
pm
->
config
->
setup_dma
=
pm
->
configcr_dma
;
pm
->
config
->
transfer_flags
|=
URB_NO_SETUP_DMA_MAP
;
pm
->
config
->
transfer_flags
|=
URB_NO_SETUP_DMA_MAP
;
...
...
drivers/usb/media/ov511.c
View file @
52db091e
...
@@ -1900,7 +1900,7 @@ sensor_get_exposure(struct usb_ov511 *ov, unsigned char *val)
...
@@ -1900,7 +1900,7 @@ sensor_get_exposure(struct usb_ov511 *ov, unsigned char *val)
case
SEN_KS0127
:
case
SEN_KS0127
:
case
SEN_KS0127B
:
case
SEN_KS0127B
:
case
SEN_SAA7111A
:
case
SEN_SAA7111A
:
val
=
0
;
val
=
NULL
;
PDEBUG
(
3
,
"Unsupported with this sensor"
);
PDEBUG
(
3
,
"Unsupported with this sensor"
);
return
-
EPERM
;
return
-
EPERM
;
default:
default:
...
...
drivers/usb/media/pwc-ctrl.c
View file @
52db091e
...
@@ -359,7 +359,7 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
...
@@ -359,7 +359,7 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
static
inline
int
set_video_mode_Kiara
(
struct
pwc_device
*
pdev
,
int
size
,
int
frames
,
int
compression
,
int
snapshot
)
static
inline
int
set_video_mode_Kiara
(
struct
pwc_device
*
pdev
,
int
size
,
int
frames
,
int
compression
,
int
snapshot
)
{
{
struct
Kiara_table_entry
*
pChoose
=
0
;
struct
Kiara_table_entry
*
pChoose
=
NULL
;
int
fps
,
ret
;
int
fps
,
ret
;
unsigned
char
buf
[
12
];
unsigned
char
buf
[
12
];
struct
Kiara_table_entry
RawEntry
=
{
6
,
773
,
1272
,
{
0xAD
,
0xF4
,
0x10
,
0x27
,
0xB6
,
0x24
,
0x96
,
0x02
,
0x30
,
0x05
,
0x03
,
0x80
}};
struct
Kiara_table_entry
RawEntry
=
{
6
,
773
,
1272
,
{
0xAD
,
0xF4
,
0x10
,
0x27
,
0xB6
,
0x24
,
0x96
,
0x02
,
0x30
,
0x05
,
0x03
,
0x80
}};
...
...
drivers/usb/media/pwc-if.c
View file @
52db091e
...
@@ -593,7 +593,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
...
@@ -593,7 +593,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
int
i
,
fst
,
flen
;
int
i
,
fst
,
flen
;
int
awake
;
int
awake
;
struct
pwc_frame_buf
*
fbuf
;
struct
pwc_frame_buf
*
fbuf
;
unsigned
char
*
fillptr
=
0
,
*
iso_buf
=
0
;
unsigned
char
*
fillptr
=
NULL
;
unsigned
char
*
iso_buf
=
NULL
;
awake
=
0
;
awake
=
0
;
pdev
=
(
struct
pwc_device
*
)
urb
->
context
;
pdev
=
(
struct
pwc_device
*
)
urb
->
context
;
...
...
drivers/usb/misc/auerswald.c
View file @
52db091e
...
@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
...
@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
dr
->
wLength
=
cpu_to_le16
(
size
);
dr
->
wLength
=
cpu_to_le16
(
size
);
usb_fill_control_urb
(
urb
,
dev
,
pipe
,
(
unsigned
char
*
)
dr
,
data
,
size
,
/* build urb */
usb_fill_control_urb
(
urb
,
dev
,
pipe
,
(
unsigned
char
*
)
dr
,
data
,
size
,
/* build urb */
auerchain_blocking_completion
,
0
);
auerchain_blocking_completion
,
NULL
);
ret
=
auerchain_start_wait_urb
(
acp
,
urb
,
timeout
,
&
length
);
ret
=
auerchain_start_wait_urb
(
acp
,
urb
,
timeout
,
&
length
);
usb_free_urb
(
urb
);
usb_free_urb
(
urb
);
...
...
drivers/usb/misc/speedtch.c
View file @
52db091e
...
@@ -1149,7 +1149,7 @@ static int udsl_usb_probe (struct usb_interface *intf, const struct usb_device_i
...
@@ -1149,7 +1149,7 @@ static int udsl_usb_probe (struct usb_interface *intf, const struct usb_device_i
}
}
/* ATM init */
/* ATM init */
if
(
!
(
instance
->
atm_dev
=
atm_dev_register
(
udsl_driver_name
,
&
udsl_atm_devops
,
-
1
,
0
)))
{
if
(
!
(
instance
->
atm_dev
=
atm_dev_register
(
udsl_driver_name
,
&
udsl_atm_devops
,
-
1
,
NULL
)))
{
dbg
(
"udsl_usb_probe: failed to register ATM device!"
);
dbg
(
"udsl_usb_probe: failed to register ATM device!"
);
goto
fail
;
goto
fail
;
}
}
...
...
drivers/usb/misc/usbtest.c
View file @
52db091e
...
@@ -121,8 +121,8 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
...
@@ -121,8 +121,8 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
for
(
tmp
=
0
;
tmp
<
intf
->
num_altsetting
;
tmp
++
)
{
for
(
tmp
=
0
;
tmp
<
intf
->
num_altsetting
;
tmp
++
)
{
unsigned
ep
;
unsigned
ep
;
in
=
out
=
0
;
in
=
out
=
NULL
;
iso_in
=
iso_out
=
0
;
iso_in
=
iso_out
=
NULL
;
alt
=
intf
->
altsetting
+
tmp
;
alt
=
intf
->
altsetting
+
tmp
;
/* take the first altsetting with in-bulk + out-bulk;
/* take the first altsetting with in-bulk + out-bulk;
...
@@ -216,11 +216,11 @@ static struct urb *simple_alloc_urb (
...
@@ -216,11 +216,11 @@ static struct urb *simple_alloc_urb (
struct
urb
*
urb
;
struct
urb
*
urb
;
if
(
bytes
<
0
)
if
(
bytes
<
0
)
return
0
;
return
NULL
;
urb
=
usb_alloc_urb
(
0
,
SLAB_KERNEL
);
urb
=
usb_alloc_urb
(
0
,
SLAB_KERNEL
);
if
(
!
urb
)
if
(
!
urb
)
return
urb
;
return
urb
;
usb_fill_bulk_urb
(
urb
,
udev
,
pipe
,
0
,
bytes
,
simple_callback
,
0
);
usb_fill_bulk_urb
(
urb
,
udev
,
pipe
,
NULL
,
bytes
,
simple_callback
,
NULL
);
urb
->
interval
=
(
udev
->
speed
==
USB_SPEED_HIGH
)
urb
->
interval
=
(
udev
->
speed
==
USB_SPEED_HIGH
)
?
(
INTERRUPT_RATE
<<
3
)
?
(
INTERRUPT_RATE
<<
3
)
:
INTERRUPT_RATE
;
:
INTERRUPT_RATE
;
...
@@ -231,7 +231,7 @@ static struct urb *simple_alloc_urb (
...
@@ -231,7 +231,7 @@ static struct urb *simple_alloc_urb (
&
urb
->
transfer_dma
);
&
urb
->
transfer_dma
);
if
(
!
urb
->
transfer_buffer
)
{
if
(
!
urb
->
transfer_buffer
)
{
usb_free_urb
(
urb
);
usb_free_urb
(
urb
);
urb
=
0
;
urb
=
NULL
;
}
else
}
else
memset
(
urb
->
transfer_buffer
,
0
,
bytes
);
memset
(
urb
->
transfer_buffer
,
0
,
bytes
);
return
urb
;
return
urb
;
...
@@ -380,7 +380,7 @@ alloc_sglist (int nents, int max, int vary)
...
@@ -380,7 +380,7 @@ alloc_sglist (int nents, int max, int vary)
sg
=
kmalloc
(
nents
*
sizeof
*
sg
,
SLAB_KERNEL
);
sg
=
kmalloc
(
nents
*
sizeof
*
sg
,
SLAB_KERNEL
);
if
(
!
sg
)
if
(
!
sg
)
return
0
;
return
NULL
;
memset
(
sg
,
0
,
nents
*
sizeof
*
sg
);
memset
(
sg
,
0
,
nents
*
sizeof
*
sg
);
for
(
i
=
0
;
i
<
nents
;
i
++
)
{
for
(
i
=
0
;
i
<
nents
;
i
++
)
{
...
@@ -389,7 +389,7 @@ alloc_sglist (int nents, int max, int vary)
...
@@ -389,7 +389,7 @@ alloc_sglist (int nents, int max, int vary)
buf
=
kmalloc
(
size
,
SLAB_KERNEL
);
buf
=
kmalloc
(
size
,
SLAB_KERNEL
);
if
(
!
buf
)
{
if
(
!
buf
)
{
free_sglist
(
sg
,
i
);
free_sglist
(
sg
,
i
);
return
0
;
return
NULL
;
}
}
memset
(
buf
,
0
,
size
);
memset
(
buf
,
0
,
size
);
...
@@ -637,7 +637,7 @@ static int ch9_postconfig (struct usbtest_dev *dev)
...
@@ -637,7 +637,7 @@ static int ch9_postconfig (struct usbtest_dev *dev)
/* and sometimes [9.2.6.6] speed dependent descriptors */
/* and sometimes [9.2.6.6] speed dependent descriptors */
if
(
udev
->
descriptor
.
bcdUSB
==
0x0200
)
{
/* pre-swapped */
if
(
udev
->
descriptor
.
bcdUSB
==
0x0200
)
{
/* pre-swapped */
struct
usb_qualifier_descriptor
*
d
=
0
;
struct
usb_qualifier_descriptor
*
d
=
NULL
;
/* device qualifier [9.6.2] */
/* device qualifier [9.6.2] */
retval
=
usb_get_descriptor
(
udev
,
retval
=
usb_get_descriptor
(
udev
,
...
@@ -817,11 +817,11 @@ static void ctrl_complete (struct urb *urb, struct pt_regs *regs)
...
@@ -817,11 +817,11 @@ static void ctrl_complete (struct urb *urb, struct pt_regs *regs)
if
((
status
=
usb_submit_urb
(
urb
,
SLAB_ATOMIC
))
!=
0
)
{
if
((
status
=
usb_submit_urb
(
urb
,
SLAB_ATOMIC
))
!=
0
)
{
dbg
(
"can't resubmit ctrl %02x.%02x, err %d"
,
dbg
(
"can't resubmit ctrl %02x.%02x, err %d"
,
reqp
->
bRequestType
,
reqp
->
bRequest
,
status
);
reqp
->
bRequestType
,
reqp
->
bRequest
,
status
);
urb
->
dev
=
0
;
urb
->
dev
=
NULL
;
}
else
}
else
ctx
->
pending
++
;
ctx
->
pending
++
;
}
else
}
else
urb
->
dev
=
0
;
urb
->
dev
=
NULL
;
/* signal completion when nothing's queued */
/* signal completion when nothing's queued */
if
(
ctx
->
pending
==
0
)
if
(
ctx
->
pending
==
0
)
...
@@ -1368,7 +1368,7 @@ static struct urb *iso_alloc_urb (
...
@@ -1368,7 +1368,7 @@ static struct urb *iso_alloc_urb (
unsigned
i
,
maxp
,
packets
;
unsigned
i
,
maxp
,
packets
;
if
(
bytes
<
0
||
!
desc
)
if
(
bytes
<
0
||
!
desc
)
return
0
;
return
NULL
;
maxp
=
0x7ff
&
desc
->
wMaxPacketSize
;
maxp
=
0x7ff
&
desc
->
wMaxPacketSize
;
maxp
*=
1
+
(
0x3
&
(
desc
->
wMaxPacketSize
>>
11
));
maxp
*=
1
+
(
0x3
&
(
desc
->
wMaxPacketSize
>>
11
));
packets
=
(
bytes
+
maxp
-
1
)
/
maxp
;
packets
=
(
bytes
+
maxp
-
1
)
/
maxp
;
...
@@ -1385,7 +1385,7 @@ static struct urb *iso_alloc_urb (
...
@@ -1385,7 +1385,7 @@ static struct urb *iso_alloc_urb (
&
urb
->
transfer_dma
);
&
urb
->
transfer_dma
);
if
(
!
urb
->
transfer_buffer
)
{
if
(
!
urb
->
transfer_buffer
)
{
usb_free_urb
(
urb
);
usb_free_urb
(
urb
);
return
0
;
return
NULL
;
}
}
memset
(
urb
->
transfer_buffer
,
0
,
bytes
);
memset
(
urb
->
transfer_buffer
,
0
,
bytes
);
for
(
i
=
0
;
i
<
packets
;
i
++
)
{
for
(
i
=
0
;
i
<
packets
;
i
++
)
{
...
...
drivers/usb/net/kaweth.c
View file @
52db091e
...
@@ -1293,7 +1293,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
...
@@ -1293,7 +1293,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
return
-
ENOMEM
;
return
-
ENOMEM
;
usb_fill_control_urb
(
urb
,
usb_dev
,
pipe
,
(
unsigned
char
*
)
cmd
,
data
,
usb_fill_control_urb
(
urb
,
usb_dev
,
pipe
,
(
unsigned
char
*
)
cmd
,
data
,
len
,
usb_api_blocking_completion
,
0
);
len
,
usb_api_blocking_completion
,
NULL
);
retv
=
usb_start_wait_urb
(
urb
,
timeout
,
&
length
);
retv
=
usb_start_wait_urb
(
urb
,
timeout
,
&
length
);
if
(
retv
<
0
)
{
if
(
retv
<
0
)
{
...
...
drivers/usb/net/usbnet.c
View file @
52db091e
...
@@ -316,7 +316,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
...
@@ -316,7 +316,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
for
(
tmp
=
0
;
tmp
<
intf
->
num_altsetting
;
tmp
++
)
{
for
(
tmp
=
0
;
tmp
<
intf
->
num_altsetting
;
tmp
++
)
{
unsigned
ep
;
unsigned
ep
;
in
=
out
=
0
;
in
=
out
=
NULL
;
alt
=
intf
->
altsetting
+
tmp
;
alt
=
intf
->
altsetting
+
tmp
;
/* take the first altsetting with in-bulk + out-bulk;
/* take the first altsetting with in-bulk + out-bulk;
...
@@ -1086,7 +1086,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
...
@@ -1086,7 +1086,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
/* ensure immediate exit from usbnet_disconnect */
/* ensure immediate exit from usbnet_disconnect */
usb_set_intfdata
(
info
->
data
,
NULL
);
usb_set_intfdata
(
info
->
data
,
NULL
);
usb_driver_release_interface
(
&
usbnet_driver
,
info
->
data
);
usb_driver_release_interface
(
&
usbnet_driver
,
info
->
data
);
info
->
data
=
0
;
info
->
data
=
NULL
;
}
}
/* and vice versa (just in case) */
/* and vice versa (just in case) */
...
@@ -1094,7 +1094,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
...
@@ -1094,7 +1094,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
/* ensure immediate exit from usbnet_disconnect */
/* ensure immediate exit from usbnet_disconnect */
usb_set_intfdata
(
info
->
control
,
NULL
);
usb_set_intfdata
(
info
->
control
,
NULL
);
usb_driver_release_interface
(
&
usbnet_driver
,
info
->
control
);
usb_driver_release_interface
(
&
usbnet_driver
,
info
->
control
);
info
->
control
=
0
;
info
->
control
=
NULL
;
}
}
}
}
...
@@ -1641,7 +1641,7 @@ nc_vendor_write (struct usbnet *dev, u8 req, u8 regnum, u16 value)
...
@@ -1641,7 +1641,7 @@ nc_vendor_write (struct usbnet *dev, u8 req, u8 regnum, u16 value)
req
,
req
,
USB_DIR_OUT
|
USB_TYPE_VENDOR
|
USB_RECIP_DEVICE
,
USB_DIR_OUT
|
USB_TYPE_VENDOR
|
USB_RECIP_DEVICE
,
value
,
regnum
,
value
,
regnum
,
0
,
0
,
// data is in setup packet
NULL
,
0
,
// data is in setup packet
CONTROL_TIMEOUT_JIFFIES
);
CONTROL_TIMEOUT_JIFFIES
);
}
}
...
@@ -2084,7 +2084,7 @@ pl_vendor_req (struct usbnet *dev, u8 req, u8 val, u8 index)
...
@@ -2084,7 +2084,7 @@ pl_vendor_req (struct usbnet *dev, u8 req, u8 val, u8 index)
req
,
req
,
USB_DIR_IN
|
USB_TYPE_VENDOR
|
USB_RECIP_DEVICE
,
USB_DIR_IN
|
USB_TYPE_VENDOR
|
USB_RECIP_DEVICE
,
val
,
index
,
val
,
index
,
0
,
0
,
NULL
,
0
,
CONTROL_TIMEOUT_JIFFIES
);
CONTROL_TIMEOUT_JIFFIES
);
}
}
...
@@ -2418,7 +2418,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
...
@@ -2418,7 +2418,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
skb_put
(
skb
,
urb
->
actual_length
);
skb_put
(
skb
,
urb
->
actual_length
);
entry
->
state
=
rx_done
;
entry
->
state
=
rx_done
;
entry
->
urb
=
0
;
entry
->
urb
=
NULL
;
switch
(
urb_status
)
{
switch
(
urb_status
)
{
// success
// success
...
@@ -2462,7 +2462,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
...
@@ -2462,7 +2462,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
block:
block:
entry
->
state
=
rx_cleanup
;
entry
->
state
=
rx_cleanup
;
entry
->
urb
=
urb
;
entry
->
urb
=
urb
;
urb
=
0
;
urb
=
NULL
;
break
;
break
;
// data overrun ... flush fifo?
// data overrun ... flush fifo?
...
@@ -2557,7 +2557,7 @@ static int usbnet_stop (struct net_device *net)
...
@@ -2557,7 +2557,7 @@ static int usbnet_stop (struct net_device *net)
schedule_timeout
(
UNLINK_TIMEOUT_JIFFIES
);
schedule_timeout
(
UNLINK_TIMEOUT_JIFFIES
);
devdbg
(
dev
,
"waited for %d urb completions"
,
temp
);
devdbg
(
dev
,
"waited for %d urb completions"
,
temp
);
}
}
dev
->
wait
=
0
;
dev
->
wait
=
NULL
;
remove_wait_queue
(
&
unlink_wakeup
,
&
wait
);
remove_wait_queue
(
&
unlink_wakeup
,
&
wait
);
/* deferred work (task, timer, softirq) must also stop.
/* deferred work (task, timer, softirq) must also stop.
...
@@ -2716,7 +2716,7 @@ kevent (void *data)
...
@@ -2716,7 +2716,7 @@ kevent (void *data)
/* tasklet could resubmit itself forever if memory is tight */
/* tasklet could resubmit itself forever if memory is tight */
if
(
test_bit
(
EVENT_RX_MEMORY
,
&
dev
->
flags
))
{
if
(
test_bit
(
EVENT_RX_MEMORY
,
&
dev
->
flags
))
{
struct
urb
*
urb
=
0
;
struct
urb
*
urb
=
NULL
;
if
(
netif_running
(
dev
->
net
))
if
(
netif_running
(
dev
->
net
))
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
...
@@ -2771,7 +2771,7 @@ static void tx_complete (struct urb *urb, struct pt_regs *regs)
...
@@ -2771,7 +2771,7 @@ static void tx_complete (struct urb *urb, struct pt_regs *regs)
}
}
}
}
urb
->
dev
=
0
;
urb
->
dev
=
NULL
;
entry
->
state
=
tx_done
;
entry
->
state
=
tx_done
;
defer_bh
(
dev
,
skb
);
defer_bh
(
dev
,
skb
);
}
}
...
@@ -2795,13 +2795,13 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
...
@@ -2795,13 +2795,13 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
struct
usbnet
*
dev
=
(
struct
usbnet
*
)
net
->
priv
;
struct
usbnet
*
dev
=
(
struct
usbnet
*
)
net
->
priv
;
int
length
;
int
length
;
int
retval
=
NET_XMIT_SUCCESS
;
int
retval
=
NET_XMIT_SUCCESS
;
struct
urb
*
urb
=
0
;
struct
urb
*
urb
=
NULL
;
struct
skb_data
*
entry
;
struct
skb_data
*
entry
;
struct
driver_info
*
info
=
dev
->
driver_info
;
struct
driver_info
*
info
=
dev
->
driver_info
;
unsigned
long
flags
;
unsigned
long
flags
;
#ifdef CONFIG_USB_NET1080
#ifdef CONFIG_USB_NET1080
struct
nc_header
*
header
=
0
;
struct
nc_header
*
header
=
NULL
;
struct
nc_trailer
*
trailer
=
0
;
struct
nc_trailer
*
trailer
=
NULL
;
#endif
/* CONFIG_USB_NET1080 */
#endif
/* CONFIG_USB_NET1080 */
// some devices want funky USB-level framing, for
// some devices want funky USB-level framing, for
...
...
drivers/usb/storage/sddr09.c
View file @
52db091e
...
@@ -1089,7 +1089,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
...
@@ -1089,7 +1089,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
if
(
result
!=
USB_STOR_TRANSPORT_GOOD
)
{
if
(
result
!=
USB_STOR_TRANSPORT_GOOD
)
{
US_DEBUGP
(
"Result of read_deviceID is %d
\n
"
,
result
);
US_DEBUGP
(
"Result of read_deviceID is %d
\n
"
,
result
);
printk
(
"sddr09: could not read card info
\n
"
);
printk
(
"sddr09: could not read card info
\n
"
);
return
0
;
return
NULL
;
}
}
sprintf
(
blurbtxt
,
"sddr09: Found Flash card, ID = %02X %02X %02X %02X"
,
sprintf
(
blurbtxt
,
"sddr09: Found Flash card, ID = %02X %02X %02X %02X"
,
...
...
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