diff options
author | Randy Dunlap <randy.dunlap@oracle.com> | 2010-04-19 11:53:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:39 -0400 |
commit | 326b4810cc995209e31136af4202ed0414814ed5 (patch) | |
tree | 45c6a550e09f155c1ea14e1ee05e55ce16ece9c6 /drivers/usb | |
parent | e8f4af304e3d16e7e512865bd53f3db811d9bbc8 (diff) |
USB: clean up some host controller sparse warnings
Fix usb sparse warnings:
drivers/usb/host/isp1362-hcd.c:2220:50: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:43:24: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:49:24: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:161:24: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:198:16: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:319:31: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:1231:33: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-pci.c:177:23: warning: non-ANSI function declaration of function 'xhci_register_pci'
drivers/usb/host/xhci-pci.c:182:26: warning: non-ANSI function declaration of function 'xhci_unregister_pci'
drivers/usb/host/xhci-ring.c:342:32: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:525:34: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:1009:32: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:1031:32: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:1041:16: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:1096:30: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-ring.c:1100:27: warning: Using plain integer as NULL pointer
drivers/usb/host/xhci-mem.c:224:27: warning: symbol 'xhci_alloc_container_ctx' was not declared. Should it be static?
drivers/usb/host/xhci-mem.c:242:6: warning: symbol 'xhci_free_container_ctx' was not declared. Should it be static?
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Signed-off By: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/isp1362-hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 14 |
4 files changed, 18 insertions, 18 deletions
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 6a6a50849bf..20a0dfe0fe3 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c | |||
@@ -2217,7 +2217,7 @@ static void create_debug_file(struct isp1362_hcd *isp1362_hcd) | |||
2217 | static void remove_debug_file(struct isp1362_hcd *isp1362_hcd) | 2217 | static void remove_debug_file(struct isp1362_hcd *isp1362_hcd) |
2218 | { | 2218 | { |
2219 | if (isp1362_hcd->pde) | 2219 | if (isp1362_hcd->pde) |
2220 | remove_proc_entry(proc_filename, 0); | 2220 | remove_proc_entry(proc_filename, NULL); |
2221 | } | 2221 | } |
2222 | 2222 | ||
2223 | #endif | 2223 | #endif |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 5711048708d..4df752cb0f7 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -41,13 +41,13 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, gfp_t flag | |||
41 | 41 | ||
42 | seg = kzalloc(sizeof *seg, flags); | 42 | seg = kzalloc(sizeof *seg, flags); |
43 | if (!seg) | 43 | if (!seg) |
44 | return 0; | 44 | return NULL; |
45 | xhci_dbg(xhci, "Allocating priv segment structure at %p\n", seg); | 45 | xhci_dbg(xhci, "Allocating priv segment structure at %p\n", seg); |
46 | 46 | ||
47 | seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); | 47 | seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); |
48 | if (!seg->trbs) { | 48 | if (!seg->trbs) { |
49 | kfree(seg); | 49 | kfree(seg); |
50 | return 0; | 50 | return NULL; |
51 | } | 51 | } |
52 | xhci_dbg(xhci, "// Allocating segment at %p (virtual) 0x%llx (DMA)\n", | 52 | xhci_dbg(xhci, "// Allocating segment at %p (virtual) 0x%llx (DMA)\n", |
53 | seg->trbs, (unsigned long long)dma); | 53 | seg->trbs, (unsigned long long)dma); |
@@ -159,7 +159,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, | |||
159 | ring = kzalloc(sizeof *(ring), flags); | 159 | ring = kzalloc(sizeof *(ring), flags); |
160 | xhci_dbg(xhci, "Allocating ring at %p\n", ring); | 160 | xhci_dbg(xhci, "Allocating ring at %p\n", ring); |
161 | if (!ring) | 161 | if (!ring) |
162 | return 0; | 162 | return NULL; |
163 | 163 | ||
164 | INIT_LIST_HEAD(&ring->td_list); | 164 | INIT_LIST_HEAD(&ring->td_list); |
165 | if (num_segs == 0) | 165 | if (num_segs == 0) |
@@ -196,7 +196,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, | |||
196 | 196 | ||
197 | fail: | 197 | fail: |
198 | xhci_ring_free(xhci, ring); | 198 | xhci_ring_free(xhci, ring); |
199 | return 0; | 199 | return NULL; |
200 | } | 200 | } |
201 | 201 | ||
202 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, | 202 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, |
@@ -247,7 +247,7 @@ static void xhci_reinit_cached_ring(struct xhci_hcd *xhci, | |||
247 | 247 | ||
248 | #define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32) | 248 | #define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32) |
249 | 249 | ||
250 | struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, | 250 | static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, |
251 | int type, gfp_t flags) | 251 | int type, gfp_t flags) |
252 | { | 252 | { |
253 | struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags); | 253 | struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags); |
@@ -265,7 +265,7 @@ struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, | |||
265 | return ctx; | 265 | return ctx; |
266 | } | 266 | } |
267 | 267 | ||
268 | void xhci_free_container_ctx(struct xhci_hcd *xhci, | 268 | static void xhci_free_container_ctx(struct xhci_hcd *xhci, |
269 | struct xhci_container_ctx *ctx) | 269 | struct xhci_container_ctx *ctx) |
270 | { | 270 | { |
271 | if (!ctx) | 271 | if (!ctx) |
@@ -764,7 +764,7 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) | |||
764 | xhci_free_container_ctx(xhci, dev->out_ctx); | 764 | xhci_free_container_ctx(xhci, dev->out_ctx); |
765 | 765 | ||
766 | kfree(xhci->devs[slot_id]); | 766 | kfree(xhci->devs[slot_id]); |
767 | xhci->devs[slot_id] = 0; | 767 | xhci->devs[slot_id] = NULL; |
768 | } | 768 | } |
769 | 769 | ||
770 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, | 770 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, |
@@ -1779,7 +1779,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
1779 | */ | 1779 | */ |
1780 | init_completion(&xhci->addr_dev); | 1780 | init_completion(&xhci->addr_dev); |
1781 | for (i = 0; i < MAX_HC_SLOTS; ++i) | 1781 | for (i = 0; i < MAX_HC_SLOTS; ++i) |
1782 | xhci->devs[i] = 0; | 1782 | xhci->devs[i] = NULL; |
1783 | 1783 | ||
1784 | if (scratchpad_alloc(xhci, flags)) | 1784 | if (scratchpad_alloc(xhci, flags)) |
1785 | goto fail; | 1785 | goto fail; |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index d295bbc15eb..edffd81fc25 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -177,12 +177,12 @@ static struct pci_driver xhci_pci_driver = { | |||
177 | .shutdown = usb_hcd_pci_shutdown, | 177 | .shutdown = usb_hcd_pci_shutdown, |
178 | }; | 178 | }; |
179 | 179 | ||
180 | int xhci_register_pci() | 180 | int xhci_register_pci(void) |
181 | { | 181 | { |
182 | return pci_register_driver(&xhci_pci_driver); | 182 | return pci_register_driver(&xhci_pci_driver); |
183 | } | 183 | } |
184 | 184 | ||
185 | void xhci_unregister_pci() | 185 | void xhci_unregister_pci(void) |
186 | { | 186 | { |
187 | pci_unregister_driver(&xhci_pci_driver); | 187 | pci_unregister_driver(&xhci_pci_driver); |
188 | } | 188 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 16ef5fd77ce..9e27eb0c700 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -388,7 +388,7 @@ static struct xhci_segment *find_trb_seg( | |||
388 | cur_seg = cur_seg->next; | 388 | cur_seg = cur_seg->next; |
389 | if (cur_seg == start_seg) | 389 | if (cur_seg == start_seg) |
390 | /* Looped over the entire list. Oops! */ | 390 | /* Looped over the entire list. Oops! */ |
391 | return 0; | 391 | return NULL; |
392 | } | 392 | } |
393 | return cur_seg; | 393 | return cur_seg; |
394 | } | 394 | } |
@@ -582,7 +582,7 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci, | |||
582 | struct xhci_ring *ep_ring; | 582 | struct xhci_ring *ep_ring; |
583 | struct xhci_virt_ep *ep; | 583 | struct xhci_virt_ep *ep; |
584 | struct list_head *entry; | 584 | struct list_head *entry; |
585 | struct xhci_td *cur_td = 0; | 585 | struct xhci_td *cur_td = NULL; |
586 | struct xhci_td *last_unlinked_td; | 586 | struct xhci_td *last_unlinked_td; |
587 | 587 | ||
588 | struct xhci_dequeue_state deq_state; | 588 | struct xhci_dequeue_state deq_state; |
@@ -1115,7 +1115,7 @@ struct xhci_segment *trb_in_td(struct xhci_segment *start_seg, | |||
1115 | 1115 | ||
1116 | do { | 1116 | do { |
1117 | if (start_dma == 0) | 1117 | if (start_dma == 0) |
1118 | return 0; | 1118 | return NULL; |
1119 | /* We may get an event for a Link TRB in the middle of a TD */ | 1119 | /* We may get an event for a Link TRB in the middle of a TD */ |
1120 | end_seg_dma = xhci_trb_virt_to_dma(cur_seg, | 1120 | end_seg_dma = xhci_trb_virt_to_dma(cur_seg, |
1121 | &cur_seg->trbs[TRBS_PER_SEGMENT - 1]); | 1121 | &cur_seg->trbs[TRBS_PER_SEGMENT - 1]); |
@@ -1137,7 +1137,7 @@ struct xhci_segment *trb_in_td(struct xhci_segment *start_seg, | |||
1137 | suspect_dma <= end_trb_dma)) | 1137 | suspect_dma <= end_trb_dma)) |
1138 | return cur_seg; | 1138 | return cur_seg; |
1139 | } | 1139 | } |
1140 | return 0; | 1140 | return NULL; |
1141 | } else { | 1141 | } else { |
1142 | /* Might still be somewhere in this segment */ | 1142 | /* Might still be somewhere in this segment */ |
1143 | if (suspect_dma >= start_dma && suspect_dma <= end_seg_dma) | 1143 | if (suspect_dma >= start_dma && suspect_dma <= end_seg_dma) |
@@ -1147,7 +1147,7 @@ struct xhci_segment *trb_in_td(struct xhci_segment *start_seg, | |||
1147 | start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]); | 1147 | start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]); |
1148 | } while (cur_seg != start_seg); | 1148 | } while (cur_seg != start_seg); |
1149 | 1149 | ||
1150 | return 0; | 1150 | return NULL; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, | 1153 | static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, |
@@ -1223,11 +1223,11 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
1223 | struct xhci_ring *ep_ring; | 1223 | struct xhci_ring *ep_ring; |
1224 | unsigned int slot_id; | 1224 | unsigned int slot_id; |
1225 | int ep_index; | 1225 | int ep_index; |
1226 | struct xhci_td *td = 0; | 1226 | struct xhci_td *td = NULL; |
1227 | dma_addr_t event_dma; | 1227 | dma_addr_t event_dma; |
1228 | struct xhci_segment *event_seg; | 1228 | struct xhci_segment *event_seg; |
1229 | union xhci_trb *event_trb; | 1229 | union xhci_trb *event_trb; |
1230 | struct urb *urb = 0; | 1230 | struct urb *urb = NULL; |
1231 | int status = -EINPROGRESS; | 1231 | int status = -EINPROGRESS; |
1232 | struct xhci_ep_ctx *ep_ctx; | 1232 | struct xhci_ep_ctx *ep_ctx; |
1233 | u32 trb_comp_code; | 1233 | u32 trb_comp_code; |