lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfqGC5KNi4mCc3Q0bD0jXb4bkkdYFSv3LDQw5E=goc2Pg@mail.gmail.com>
Date:   Wed, 11 Jul 2018 10:23:28 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Xiaowei Song <songxiaowei@...ilicon.com>
Cc:     Wangbinghui <wangbinghui@...ilicon.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Rob Herring <robh+dt@...nel.org>, linux-pci@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Suzhuangluan <suzhuangluan@...ilicon.com>,
        Kongfei <kongfei@...ilicon.com>, Yao Chen <chenyao11@...wei.com>
Subject: Re: [PATCH v6 1/1] PCI: kirin: Add MSI support

On Wed, Jul 11, 2018 at 9:57 AM, Xiaowei Song <songxiaowei@...ilicon.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.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ