EDAC: Delete unnecessary check before calling pci_dev_put()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 19 Nov 2014 15:00:13 +0000 (16:00 +0100)
committerBorislav Petkov <bp@suse.de>
Wed, 19 Nov 2014 15:33:48 +0000 (16:33 +0100)
The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test before the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: http://lkml.kernel.org/r/546CB20D.4070808@users.sourceforge.net
[ Boris: commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/i3000_edac.c
drivers/edac/i3200_edac.c
drivers/edac/i82443bxgx_edac.c
drivers/edac/x38_edac.c

index cd28b968e5c7a19e21105a1a2252e84a26f70074..5cb36a6022cc9eb31725343d0e712759d827dcf5 100644 (file)
@@ -542,8 +542,7 @@ fail1:
        pci_unregister_driver(&i3000_driver);
 
 fail0:
-       if (mci_pdev)
-               pci_dev_put(mci_pdev);
+       pci_dev_put(mci_pdev);
 
        return pci_rc;
 }
index 022a70273ada730a1c6afe6355387041dda36f2b..d1ff0ea2d3f3b99d694bae39ae59300ba5be8d16 100644 (file)
@@ -523,8 +523,7 @@ fail1:
        pci_unregister_driver(&i3200_driver);
 
 fail0:
-       if (mci_pdev)
-               pci_dev_put(mci_pdev);
+       pci_dev_put(mci_pdev);
 
        return pci_rc;
 }
index d730e276d1a8437526f168e83f503c1d5c236473..b4705d9366bf33d3c6223aacf8f47b8461b25a59 100644 (file)
@@ -458,8 +458,7 @@ static void __exit i82443bxgx_edacmc_exit(void)
        if (!i82443bxgx_registered)
                i82443bxgx_edacmc_remove_one(mci_pdev);
 
-       if (mci_pdev)
-               pci_dev_put(mci_pdev);
+       pci_dev_put(mci_pdev);
 }
 
 module_init(i82443bxgx_edacmc_init);
index e644b52c287c41b3eddb206d24c283c4f1f7f6e9..7c5cdc62f31c35902e8c20d8af7c1c4bea431de1 100644 (file)
@@ -500,8 +500,7 @@ fail1:
        pci_unregister_driver(&x38_driver);
 
 fail0:
-       if (mci_pdev)
-               pci_dev_put(mci_pdev);
+       pci_dev_put(mci_pdev);
 
        return pci_rc;
 }