On 07/11/2014 06:21 PM, Ethan Zhao wrote: > On Fri, Jul 11, 2014 at 8:42 PM, Varka Bhadram wrote: >> On 07/11/2014 06:00 PM, Ethan Zhao wrote: >>> Current implementation of helper function pci_vfs_assigned() is a >>> little complex, to get sum of VFs that assigned to VM, access low >>> level configuration space register and then loop in traversing >>> device tree. >> >> (...) >> >> >>> @@ -650,6 +630,11 @@ EXPORT_SYMBOL_GPL(pci_vfs_assigned); >>> void pci_iov_assign_device(struct pci_dev *pdev) >>> { >>> pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; >>> + if (pdev->is_virtfn && !pdev->is_physfn) >>> + if (pdev->physfn) >>> + if (pdev->physfn->sriov) >> >> Why don't we make last two 'if' conditions into single 'if' >> >> if (pdev->physfn && pdev->physfn->sriov) > Yeah, this one looks better, that style used to tell myself, I might > forget the which side of && operator first, if you sure left first, > I prefer that too :> |for && operator - evaluation is from Left to Right| -- Regards, Varka Bhadram.