The patch titled
     drivers/video: remove unnecessary pci_dev_put
has been added to the -mm tree.  Its filename is
     drivers-video-remove-unnecessary-pci_dev_put.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: drivers/video: remove unnecessary pci_dev_put
From: Julia Lawall <[EMAIL PROTECTED]>

pci_get_class implicitly does a pci_dev_put on its second argument, so
pci_dev_put is only needed if there is a break out of the loop.

The semantic match detecting this problem is as follows:

// <smpl>
@@
expression dev;
expression E;
@@

* pci_dev_put(dev)
  ... when != dev = E
(
* pci_get_device(...,dev)
|
* pci_get_device_reverse(...,dev)
|
* pci_get_subsys(...,dev)
|
* pci_get_class(...,dev)
)
// </smpl>

Signed-off-by: Julia Lawall <[EMAIL PROTECTED]>
Cc: Thomas Winischhofer <[EMAIL PROTECTED]>
Cc: "Antonino A. Daplas" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/video/sis/sis_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/video/sis/sis_main.c~drivers-video-remove-unnecessary-pci_dev_put 
drivers/video/sis/sis_main.c
--- a/drivers/video/sis/sis_main.c~drivers-video-remove-unnecessary-pci_dev_put
+++ a/drivers/video/sis/sis_main.c
@@ -4621,9 +4621,9 @@ sisfb_find_host_bridge(struct sis_video_
 
        while((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST, pdev))) {
                temp = pdev->vendor;
-               pci_dev_put(pdev);
                if(temp == pcivendor) {
                        ret = 1;
+                       pci_dev_put(pdev);
                        break;
                }
        }
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

git-alsa.patch
drivers-char-remove-unnecessary-pci_dev_put.patch
arch-ppc-remove-an-unnecessary-pci_dev_put.patch
git-sparc64.patch
drivers-video-remove-unnecessary-pci_dev_put.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to