sh_eth: kill redundant check in the probe() method
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 31 Dec 2017 18:41:36 +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/sh_eth.c

index 75323000c3646bc781c12287367f8b455ada5a6a..d47bbbb22e7c86fdfc768827da0f9aff44126cdb 100644 (file)
@@ -3282,8 +3282,7 @@ out_napi_del:
 
 out_release:
        /* net_dev free */
-       if (ndev)
-               free_netdev(ndev);
+       free_netdev(ndev);
 
        pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);