çå: [PATCH v6 1/1] PCI: kirin: Add MSI support

From: Songxiaowei (Kirin_DRV)
Date: Wed Jul 11 2018 - 03:36:44 EST




> -----éäåä-----
> åää: Andy Shevchenko [mailto:andy.shevchenko@xxxxxxxxx]
> åéæé: 2018å7æ11æ 15:23
> æää: Songxiaowei (Kirin_DRV) <songxiaowei@xxxxxxxxxxxxx>
> æé: Wangbinghui <wangbinghui@xxxxxxxxxxxxx>; Bjorn Helgaas
> <bhelgaas@xxxxxxxxxx>; Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>;
> Rob Herring <robh+dt@xxxxxxxxxx>; linux-pci@xxxxxxxxxxxxxxx; Linux Kernel
> Mailing List <linux-kernel@xxxxxxxxxxxxxxx>; Suzhuangluan
> <suzhuangluan@xxxxxxxxxxxxx>; Kongfei <kongfei@xxxxxxxxxxxxx>; chenyao
> (F) <chenyao11@xxxxxxxxxx>
> äé: Re: [PATCH v6 1/1] PCI: kirin: Add MSI support
>
> On Wed, Jul 11, 2018 at 9:57 AM, Xiaowei Song <songxiaowei@xxxxxxxxxxxxx>
> wrote:
> > Add support for MSI
>
> > +static int kirin_pcie_add_msi(struct dw_pcie *pci,
> > + struct platform_device *pdev) {
> > + int ret = 0;
> > +
> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
> > + ret = platform_get_irq(pdev, 0);
> > + if (ret < 0) {
> > + dev_err(&pdev->dev,
> > + "failed to get MSI IRQ (%d)\n", ret);
> > + return ret;
> > + }
> > +
> > + pci->pp.msi_irq = ret;
> > + }
> > +
> > + return ret;
> > +}
>
> Like someone already noticed, is it really IRQ number you would like to
> return?
>
> If you rewrite like
>
> int irq;
>
> if (IS_ENABLED(...)) {
> irq = ...
> if (irq < 0)
> return irq;
>
> ... = irq;
>
> }
>
> return 0;
>
> It would be slightly more explicit what you do and what you return.
>

Hi Andy
I think did not get Lorenzo's meaning before, thank you so much, and I'll modify the patch as soon as possible.
Best Regards,
Xiaowei Song.
> --
> With Best Regards,
> Andy Shevchenko