Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk, Peter Marheine. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59275 )
Change subject: pcidev: Avoid internal programmer relying on pacc global ......................................................................
Patch Set 2:
(5 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/59275/comment/798a687f_1e8ee16b PS2, Line 7: Avoid internal relying on pacc global
I guess the "internal" programmer was meant.
Yes, "internal" was meant to mean "internal programmer". I added that to the commit message but feel free to adjust if my grammar isn't ideal.
File internal.c:
https://review.coreboot.org/c/flashrom/+/59275/comment/1f3e461b_e7f7570c PS2, Line 38: NULL
I guess this just happened to work. We might need `pacc` here too eventually.
ACK, will look into that as a follow up in the pcidev series here. Thanks for pointing it out Nico.
https://review.coreboot.org/c/flashrom/+/59275/comment/3c994fe4_098e28ff PS2, Line 41: temp = pcidev_scandev(&filter); : if (temp) { : /* Read PCI class */ : tmp2 = pci_read_word(temp, 0x0a); : if (tmp2 == devclass) : return temp; : }
The original code would continue walking the linked list of devices if `tmp2 == devclass` is false. […]
Done. Thank you!
https://review.coreboot.org/c/flashrom/+/59275/comment/be03f653_0fcce7e4 PS2, Line 73: temp = pcidev_scandev(&filter); : if (temp) { : if ((card_vendor == pci_read_word(temp, PCI_SUBSYSTEM_VENDOR_ID)) : && (card_device == pci_read_word(temp, PCI_SUBSYSTEM_ID))) : return temp; : }
Same situation as in `pci_dev_find_vendorclass()`, see comment above.
Done.
File pcidev.c:
https://review.coreboot.org/c/flashrom/+/59275/comment/8f30f24d_eb7e29d6 PS2, Line 151: struct pci_dev *pcidev_scandev(struct pci_filter *filter) : { : struct pci_dev *temp; : for (temp = pacc->devices; temp; temp = temp->next) : if (pci_filter_match(filter, temp)) : return temp; : return NULL; : }
To allow resuming searches (see `internal.c` comments), I'd modify this function as follows: […]
Done