Re: [PATCH] PCI: merge slot and bus reset implementations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 07, 2021 at 09:49:03AM +0200, Krzysztof Wilczyński wrote:
> [+cc Greg for visibility]
> 
> Hello,
> 
> [...]
> > > > > > The previous coding style is preferable one in the Linux kernel.
> > > > > > int rc = pci_dev_reset_slot_function(dev, probe);
> > > > > > if (rc != -ENOTTY)
> > > > > >   return rc;
> > > > > > return pci_parent_bus_reset(dev, probe);  
> > > > > 
> > > > > 
> > > > > That'd be news to me, do you have a reference?  I've never seen
> > > > > complaints for ternaries previously.  Thanks,  
> > > > 
> > > > The complaint is not to ternaries, but to the function call as one of
> > > > the parameters, that makes it harder to read.
> > > 
> > > Sorry, I don't find a function call as a parameter to a ternary to be
> > > extraordinary, nor do I find it to be a discouraged usage model within
> > > the kernel.  This seems like a pretty low bar for hard to read code.
> > 
> > It is up to us where this bar is set.
> 
> The only person who ever pulled my ear, so to speak, over using ternary
> was Greg as a bad style where, especially where it does not need to be
> used.

Good to hear that I'm not alone.

> 
> But, I digress.  I humbly think that we should move back on track and
> finish review of Raphael's patch.  Would use a ternary here be
> a show-stopper?

Of course no, I would fix it locally when apply.

Thanks

> 
> Krzysztof



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux