[PATCH 2/2] nvme/pci: Enable SR-IOV capabilities

Bjorn Helgaas helgaas at kernel.org
Mon May 23 14:51:57 PDT 2016


On Mon, May 23, 2016 at 01:21:44PM -0400, Keith Busch wrote:
> On Mon, May 23, 2016 at 12:06:52PM -0500, Bjorn Helgaas wrote:
> > I do not subscribe to the belief that every function should have a
> > single exit.  In this case, I think it makes the function much harder
> > to understand than this:
> 
> No problem with multiple exists. 
>  
> >   if (numvfs == 0)
> >     pci_disable_sriov(pdev);
> >     return 0;
> >   }
> > 
> >   return pci_enable_sriov(pdev, numvfs);
> 
> Slight change to the above: pci_enable_sriov returns 0 on success,
> but a driver's .sriov_configure is supposed to return the number of
> VF's successfully configured, so need to return 'numvfs' on success.

Oops, sorry, excuse me while I wipe the egg off my face :)



More information about the Linux-nvme mailing list