Re: [PATCH v10 8/8] PCI: Change the type of probe argument in reset functions

From: Bjorn Helgaas
Date: Wed Jul 28 2021 - 13:55:30 EST

On Wed, Jul 28, 2021 at 11:05:14PM +0530, Amey Narkhede wrote:
> On 21/07/27 05:22PM, Bjorn Helgaas wrote:
> > On Fri, Jul 09, 2021 at 06:08:13PM +0530, Amey Narkhede wrote:
> > > Introduce a new enum pci_reset_mode_t to make the context of probe argument
> > > in reset functions clear and the code easier to read. Change the type of
> > > probe argument in functions which implement reset methods from int to
> > > pci_reset_mode_t to make the intent clear.
> >
> > Not sure adding an enum and a PCI_RESET_MODE_MAX seems worth it to me.
> > It's really a boolean parameter, and I'd be happy to change it to a
> > bool. But I don't think it's worth checking against
> > PCI_RESET_MODE_MAX unless we need more than two options.
> >
> Is it okay to use PCI_RESET_PROBE and PCI_RESET_DO_RESET as bool.
> That would be less confusing than directly using true/false.

You mean like this?

#define PCI_RESET_DO_RESET false
#define PCI_RESET_PROBE true

I don't think there's a huge amount of value, but I guess that's OK as
long as it's confined to drivers/pci/, i.e., not exposed via