Re: [PATCH] pci_find_device --> pci_get_device

Jiri Slaby
2005-07-20T10:45:00Z

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.

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

aren't the same or these:

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;
AND
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 you add braces after if's please add the '{' in the same line as the if
>itself. This will make the diff bigger, but then this matches
>Documentation/Coding-style.
>
>
Ok, this has been improved.

* Added for_each_pci_dev wherever it is appropriate.