lkml.org 
[lkml]   [2018]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject答复: [PATCH v6 1/1] PCI: kirin: Add MSI su pport
Date


> -----邮件原件-----
> 发件人: Andy Shevchenko [mailto:andy.shevchenko@gmail.com]
> 发送时间: 2018年7月11日 15:23
> 收件人: Songxiaowei (Kirin_DRV) <songxiaowei@hisilicon.com>
> 抄送: Wangbinghui <wangbinghui@hisilicon.com>; Bjorn Helgaas
> <bhelgaas@google.com>; Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>;
> Rob Herring <robh+dt@kernel.org>; linux-pci@vger.kernel.org; Linux Kernel
> Mailing List <linux-kernel@vger.kernel.org>; Suzhuangluan
> <suzhuangluan@hisilicon.com>; Kongfei <kongfei@hisilicon.com>; chenyao
> (F) <chenyao11@huawei.com>
> 主题: Re: [PATCH v6 1/1] PCI: kirin: Add MSI support
>
> On Wed, Jul 11, 2018 at 9:57 AM, Xiaowei Song <songxiaowei@hisilicon.com>
> 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
\
 
 \ /
  Last update: 2018-07-11 09:37    [W:0.026 / U:2.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site