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: <CAHp75Ve4t8Pas5t+wdNWyN_Z9w_V4jcYbxjfgOmru_DimfGV=A@mail.gmail.com>
Date:   Thu, 6 Jan 2022 16:28:29 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Niklas Söderlund <niklas.soderlund@...natech.se>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Rob Herring <robh+dt@...nel.org>,
        Prabhakar <prabhakar.csengg@...il.com>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] thermal: rcar_thermal: Use platform_get_irq_optional()
 to get the interrupt

On Tue, Jan 4, 2022 at 4:52 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> wrote:
>
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_optional().

...

>         for (i = 0; i < chip->nirqs; i++) {
> -               irq = platform_get_resource(pdev, IORESOURCE_IRQ, i);
> -               if (!irq)
> -                       continue;
> +               int irq;

> +               irq = platform_get_irq_optional(pdev, i);
> +               if (irq < 0 && irq != -ENXIO) {
> +                       ret = irq;
> +                       goto error_unregister;
> +               }
> +               if (!irq || irq == -ENXIO)
> +                       break;

Wouldn't be better to assign to ret

               ret = platform_get_irq_optional(pdev, i);
               if (ret < 0 && ret != -ENXIO)
                       goto error_unregister;
               if (ret > 0)
                       irq = ret;
               else
                       break;

?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ