Commit 51b91b7e authored by Julia Lawall's avatar Julia Lawall Committed by Felipe Balbi

usb: gadget: 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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 9a9ce1df
...@@ -324,7 +324,6 @@ static void bdc_mem_free(struct bdc *bdc) ...@@ -324,7 +324,6 @@ static void bdc_mem_free(struct bdc *bdc)
bdc->scratchpad.buff, bdc->scratchpad.sp_dma); bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
/* Destroy the dma pools */ /* Destroy the dma pools */
if (bdc->bd_table_pool)
dma_pool_destroy(bdc->bd_table_pool); dma_pool_destroy(bdc->bd_table_pool);
/* Free the bdc_ep array */ /* Free the bdc_ep array */
......
...@@ -2117,7 +2117,6 @@ static int gr_remove(struct platform_device *pdev) ...@@ -2117,7 +2117,6 @@ static int gr_remove(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
gr_dfs_delete(dev); gr_dfs_delete(dev);
if (dev->desc_pool)
dma_pool_destroy(dev->desc_pool); dma_pool_destroy(dev->desc_pool);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
......
...@@ -1767,7 +1767,6 @@ static int mv_u3d_remove(struct platform_device *dev) ...@@ -1767,7 +1767,6 @@ static int mv_u3d_remove(struct platform_device *dev)
usb_del_gadget_udc(&u3d->gadget); usb_del_gadget_udc(&u3d->gadget);
/* free memory allocated in probe */ /* free memory allocated in probe */
if (u3d->trb_pool)
dma_pool_destroy(u3d->trb_pool); dma_pool_destroy(u3d->trb_pool);
if (u3d->ep_context) if (u3d->ep_context)
......
...@@ -2100,7 +2100,6 @@ static int mv_udc_remove(struct platform_device *pdev) ...@@ -2100,7 +2100,6 @@ static int mv_udc_remove(struct platform_device *pdev)
} }
/* free memory allocated in probe */ /* free memory allocated in probe */
if (udc->dtd_pool)
dma_pool_destroy(udc->dtd_pool); dma_pool_destroy(udc->dtd_pool);
if (udc->ep_dqh) if (udc->ep_dqh)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment