Re: [PATCH v3 2/2] PCI: keembay: Add support for Intel Keem Bay

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

 



On Thu, Dec 10, 2020 at 11:46:48AM -0600, Rob Herring wrote:
> On Wed, Dec 9, 2020 at 12:41 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Wed, Dec 09, 2020 at 12:13:50PM -0600, Rob Herring wrote:
> > > On Wed, Dec 02, 2020 at 03:31:56PM +0800, Wan Ahmad Zainie wrote:

...

> > > > +   struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
> > > > +
> > > > +   switch (type) {
> > > > +   case PCI_EPC_IRQ_LEGACY:
> > > > +           /* Legacy interrupts are not supported in Keem Bay */
> > > > +           dev_err(pci->dev, "Legacy IRQ is not supported\n");
> > > > +           return -EINVAL;
> > > > +   case PCI_EPC_IRQ_MSI:
> > > > +           return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
> > > > +   case PCI_EPC_IRQ_MSIX:
> > > > +           return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
> > > > +   default:
> > > > +           dev_err(pci->dev, "Unknown IRQ type %d\n", type);
> > > > +           return -EINVAL;
> > > > +   }
> > >
> > > Doesn't the lack of a 'return' give a warning?
> >
> > Where? I don't see any lack of return.
> 
> Is the compiler smart enough to recognize that with a return in every
> 'case' that we don't need a return after the switch? I wouldn't have
> thought so, but I haven't checked.

Dunno what happen with -O0, but with -O2 we certainly have no issues with above
code. (And for the record there are plenty examples of the same over the kernel)

-- 
With Best Regards,
Andy Shevchenko





[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