Re: [PATCH] pci_find_device --> pci_get_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rolf Eike Beer napsal(a):

Am Mittwoch, 20. Juli 2005 12:40 schrieb Jiri Slaby:
Rolf Eike Beer napsal(a):
Your patch to arch/sparc64/kernel/ebus.c is broken, the removed and added
parts do not match in behaviour.
I can't still see the difference.

diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -527,8 +527,15 @@ static struct pci_dev *find_next_ebus(st
{
	struct pci_dev *pdev = start;

-	do {
-		pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev);
+    while (pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev))
+		if (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
+			pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)
+			break;
+
+	*is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS));
+	
+/*	do { // BEFORE \/           AFTER ^
+ *		pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev);
		if (pdev &&
		    (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
		     pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS))
The code was:
 do {
     pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev);
       if (pdev &&
           (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
            pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS))
           break;
   } while (pdev != NULL);

   if (pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS))
       *is_rio_p = 1;
   else
       *is_rio_p = 0;

and I changed to:
   while (pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev))
       if (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
           pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)
           break;

   *is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS));

Is there any difference? I don't see any, but... The reading of diff file in this case is not the best, maybe...

--
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      [email protected]      ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux