diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-09-13 08:14:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 05:38:33 -0400 |
commit | c7360b343ab1f1442e0731eb9e31e2a89fa6f97c (patch) | |
tree | 43ae4010903d9c55dcaa85721978fb65cd90ae7f | |
parent | 03bce87ce99ae6611ad8c03d509b2da59d86183d (diff) |
xhci: drop null test before destroy functions
Remove unneeded NULL test.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@ expression x; @@
-if (x != NULL)
\(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index bc540903542a..c48cbe731356 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1828,24 +1828,20 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1828 | for (i = 1; i < MAX_HC_SLOTS; ++i) | 1828 | for (i = 1; i < MAX_HC_SLOTS; ++i) |
1829 | xhci_free_virt_device(xhci, i); | 1829 | xhci_free_virt_device(xhci, i); |
1830 | 1830 | ||
1831 | if (xhci->segment_pool) | 1831 | dma_pool_destroy(xhci->segment_pool); |
1832 | dma_pool_destroy(xhci->segment_pool); | ||
1833 | xhci->segment_pool = NULL; | 1832 | xhci->segment_pool = NULL; |
1834 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed segment pool"); | 1833 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed segment pool"); |
1835 | 1834 | ||
1836 | if (xhci->device_pool) | 1835 | dma_pool_destroy(xhci->device_pool); |
1837 | dma_pool_destroy(xhci->device_pool); | ||
1838 | xhci->device_pool = NULL; | 1836 | xhci->device_pool = NULL; |
1839 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed device context pool"); | 1837 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed device context pool"); |
1840 | 1838 | ||
1841 | if (xhci->small_streams_pool) | 1839 | dma_pool_destroy(xhci->small_streams_pool); |
1842 | dma_pool_destroy(xhci->small_streams_pool); | ||
1843 | xhci->small_streams_pool = NULL; | 1840 | xhci->small_streams_pool = NULL; |
1844 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 1841 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
1845 | "Freed small stream array pool"); | 1842 | "Freed small stream array pool"); |
1846 | 1843 | ||
1847 | if (xhci->medium_streams_pool) | 1844 | dma_pool_destroy(xhci->medium_streams_pool); |
1848 | dma_pool_destroy(xhci->medium_streams_pool); | ||
1849 | xhci->medium_streams_pool = NULL; | 1845 | xhci->medium_streams_pool = NULL; |
1850 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 1846 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
1851 | "Freed medium stream array pool"); | 1847 | "Freed medium stream array pool"); |