Explorar el Código

ravb: kill redundant check in the probe() method

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>
Sergei Shtylyov hace 8 años
padre
commit
5d0c100c22
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      drivers/net/ethernet/renesas/ravb_main.c

+ 1 - 2
drivers/net/ethernet/renesas/ravb_main.c

@@ -2205,8 +2205,7 @@ out_dma_free:
 	if (chip_id != RCAR_GEN2)
 	if (chip_id != RCAR_GEN2)
 		ravb_ptp_stop(ndev);
 		ravb_ptp_stop(ndev);
 out_release:
 out_release:
-	if (ndev)
-		free_netdev(ndev);
+	free_netdev(ndev);
 
 
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);