Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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 */
+1 −2
Original line number Original line Diff line number Diff line
@@ -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);


+1 −2
Original line number Original line Diff line number Diff line
@@ -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)
+1 −2
Original line number Original line Diff line number Diff line
@@ -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)