]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ravb: kill redundant check in the probe() method
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 31 Dec 2017 18:41:35 +0000 (21:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jan 2018 15:21:35 +0000 (10:21 -0500)
Browsing thru the driver disassembly, I noticed that gcc was  able to
figure  out  that the 'ndev' pointer is always non-NULL when calling
free_netdev()  on the probe() method's  error path and  thus skip that
redundant NULL check... gcc is smart, be like gcc! :-)

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/ravb_main.c

index 009780df664b4a09ea3e88855b0e707ff0b24b10..c87f57ca44371586d30f56985010a115a38c8aa1 100644 (file)
@@ -2205,8 +2205,7 @@ out_dma_free:
        if (chip_id != RCAR_GEN2)
                ravb_ptp_stop(ndev);
 out_release:
-       if (ndev)
-               free_netdev(ndev);
+       free_netdev(ndev);
 
        pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);