net: ep93xx_eth: Delete unnecessary checks before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 4 Feb 2015 14:56:58 +0000 (15:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Feb 2015 08:35:00 +0000 (00:35 -0800)
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cirrus/ep93xx_eth.c

index 3a12c096ea1c2943b84c2489f92a9dcc62d2ecc4..de9f7c97d916d3d8d760282e726cf49f4181a56b 100644 (file)
@@ -475,8 +475,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
                if (d)
                        dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_FROM_DEVICE);
 
-               if (ep->rx_buf[i] != NULL)
-                       kfree(ep->rx_buf[i]);
+               kfree(ep->rx_buf[i]);
        }
 
        for (i = 0; i < TX_QUEUE_ENTRIES; i++) {
@@ -486,8 +485,7 @@ static void ep93xx_free_buffers(struct ep93xx_priv *ep)
                if (d)
                        dma_unmap_single(dev, d, PKT_BUF_SIZE, DMA_TO_DEVICE);
 
-               if (ep->tx_buf[i] != NULL)
-                       kfree(ep->tx_buf[i]);
+               kfree(ep->tx_buf[i]);
        }
 
        dma_free_coherent(dev, sizeof(struct ep93xx_descs), ep->descs,