On Tue, Nov 09, 2021 at 07:55:43AM -0800, Tom Rix wrote:
On 11/9/21 7:41 AM, Andy Shevchenko wrote:Thanks for review, my answers below.
Currently the find_dfls_by_vsec() opens code pci_find_vsec_capability().
Refactor the former to use the latter. No functional change intended.
...
I don't think so. The rule of thumb that the types should match the value they+ u16 voff;The later use of voff in pci_read_config_dword is of type 'int', it may be
better to keep voff as an int.
got in the first place. In this case it's u16. Compiler will implicitly cast it
to whatever is needed as long as the type is good for integer promotion.
...
This does not change the original code. If you think so, this can be extended+ voff = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_DFLS);This may be a weakness in the origin code, but intel isn't the exclusive
user of DFL.
later on.
if (!voff) {
dev_dbg(&pcidev->dev, "%s no DFL VSEC found\n", __func__);
return -ENODEV;