Skip to content

Commit

Permalink
tile/PCI: use for_each_pci_dev to simplify the code
Browse files Browse the repository at this point in the history
Use for_each_pci_dev to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
  • Loading branch information
Wei Yongjun authored and Chris Metcalf committed Dec 12, 2012
1 parent 5955a59 commit 17a2635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/tile/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static void __devinit fixup_read_and_payload_sizes(void)
u16 new_values;

/* Scan for the smallest maximum payload size. */
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
for_each_pci_dev(dev) {
u32 devcap;
int max_payload;

Expand All @@ -260,7 +260,7 @@ static void __devinit fixup_read_and_payload_sizes(void)

/* Now, set the max_payload_size for all devices to that value. */
new_values = (max_read_size << 12) | (smallest_max_payload << 5);
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
for_each_pci_dev(dev)
pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ,
new_values);
Expand Down

0 comments on commit 17a2635

Please sign in to comment.