On 16/03/2016 12:27, Michael Tokarev wrote: >> > for (tmp = pdev->config[PCI_CAPABILITY_LIST]; tmp; >> > - tmp = pdev->config[tmp + 1]) { >> > + tmp = pdev->config[tmp + PCI_CAP_LIST_NEXT]) { >> > - next = pdev->config[pos + 1]; >> > + next = pdev->config[pos + PCI_CAP_LIST_NEXT]; > Hmm. I'm not sure the new version is better, to me "+1" reads > easier than the new symbolic constant variant. > > If it were something like pdev->config[PCI_CAP_LIST_NEXT], that'd be > nice, but not "pos + PCI_CAP_LIST_NEXT". > > But again, I'm not pci config space expert and don't understand > the basics :)
Each capability is a node of a linked list, and the position of the next capability is at offset 1 inside the capability (here it is at offset 1 from the tmp or pos base). I think the patch is an improvement. Paolo