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

atm: he: 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: David S. Miller <davem@davemloft.net>

authored by

Julia Lawall and committed by
David S. Miller
58d29e3c 982b5270

+2 -5
+2 -5
drivers/atm/he.c
··· 1578 1578 1579 1579 kfree(he_dev->rbpl_virt); 1580 1580 kfree(he_dev->rbpl_table); 1581 - 1582 - if (he_dev->rbpl_pool) 1583 - dma_pool_destroy(he_dev->rbpl_pool); 1581 + dma_pool_destroy(he_dev->rbpl_pool); 1584 1582 1585 1583 if (he_dev->rbrq_base) 1586 1584 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), ··· 1592 1594 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), 1593 1595 he_dev->tpdrq_base, he_dev->tpdrq_phys); 1594 1596 1595 - if (he_dev->tpd_pool) 1596 - dma_pool_destroy(he_dev->tpd_pool); 1597 + dma_pool_destroy(he_dev->tpd_pool); 1597 1598 1598 1599 if (he_dev->pci_dev) { 1599 1600 pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command);