Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB-EHCI: Delete unnecessary checks before the function call "dma_pool_destroy"

The dma_pool_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Markus Elfring and committed by
Greg Kroah-Hartman
a7a19d7a 84c1eeb0

+5 -13
+5 -13
drivers/usb/host/ehci-mem.c
··· 128 128 ehci->dummy = NULL; 129 129 130 130 /* DMA consistent memory and pools */ 131 - if (ehci->qtd_pool) 132 - dma_pool_destroy (ehci->qtd_pool); 131 + dma_pool_destroy(ehci->qtd_pool); 133 132 ehci->qtd_pool = NULL; 134 - 135 - if (ehci->qh_pool) { 136 - dma_pool_destroy (ehci->qh_pool); 137 - ehci->qh_pool = NULL; 138 - } 139 - 140 - if (ehci->itd_pool) 141 - dma_pool_destroy (ehci->itd_pool); 133 + dma_pool_destroy(ehci->qh_pool); 134 + ehci->qh_pool = NULL; 135 + dma_pool_destroy(ehci->itd_pool); 142 136 ehci->itd_pool = NULL; 143 - 144 - if (ehci->sitd_pool) 145 - dma_pool_destroy (ehci->sitd_pool); 137 + dma_pool_destroy(ehci->sitd_pool); 146 138 ehci->sitd_pool = NULL; 147 139 148 140 if (ehci->periodic)