]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: stmmac: Rewrite two test against NULL value
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Wed, 8 Feb 2017 08:31:16 +0000 (09:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2017 20:11:25 +0000 (15:11 -0500)
This patch rewrite two test against NULL value with correct style.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index ed813752e23b96e8d490ce7b6acbd8056f1768b4..cc88bdb929dda4df89ac4ae39e55df80346da2e7 100644 (file)
@@ -689,7 +689,7 @@ static void stmmac_adjust_link(struct net_device *dev)
        int new_state = 0;
        unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
 
-       if (phydev == NULL)
+       if (!phydev)
                return;
 
        spin_lock_irqsave(&priv->lock, flags);
@@ -1131,7 +1131,7 @@ static void dma_free_tx_skbufs(struct stmmac_priv *priv)
                                                 DMA_TO_DEVICE);
                }
 
-               if (priv->tx_skbuff[i] != NULL) {
+               if (priv->tx_skbuff[i]) {
                        dev_kfree_skb_any(priv->tx_skbuff[i]);
                        priv->tx_skbuff[i] = NULL;
                        priv->tx_skbuff_dma[i].buf = 0;