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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Jan 2022 23:43:19 +0100
From:   Uwe Kleine-König <>
To:     Sergey Shtylyov <>
Cc:     Mark Brown <>, Andrew Lunn <>,
        Ulf Hansson <>,
        Vignesh Raghavendra <>,
        KVM list <>,
        "Rafael J. Wysocki" <>,,
        Linus Walleij <>,
        Amit Kucheria <>,
        ALSA Development Mailing List <>,
        Jaroslav Kysela <>,
        Guenter Roeck <>,
        Thierry Reding <>,
        MTD Maling List <>,
        Linux I2C <>,
        "open list:GPIO SUBSYSTEM" <>,
        Miquel Raynal <>,,,
        linux-spi <>,
        Jiri Slaby <>,
        Khuong Dinh <>,
        Florian Fainelli <>,
        Matthias Schiffer <>,
        Kamal Dasu <>,
        Lee Jones <>,
        Bartosz Golaszewski <>,
        Daniel Lezcano <>,
        Kishon Vijay Abraham I <>,
        Geert Uytterhoeven <>,
        "open list:SERIAL DRIVERS" <>,
        bcm-kernel-feedback-list <>,
        Zhang Rui <>,,
        Linux PWM List <>,
        Robert Richter <>,
        Saravanan Sekar <>,
        Corey Minyard <>,
        Linux PM list <>,
        Liam Girdwood <>,
        Mauro Carvalho Chehab <>,
        John Garry <>,
        Takashi Iwai <>,
        Peter Korsgaard <>,
        William Breathitt Gray <>,
        Mark Gross <>,
        Hans de Goede <>,
        Alex Williamson <>,
        Borislav Petkov <>,
        Jakub Kicinski <>,
        Matthias Brugger <>,,
        Andy Shevchenko <>,
        Benson Leung <>,
        Pengutronix Kernel Team <>,
        Linux ARM <>,, Tony Luck <>,
        Richard Weinberger <>,
        Mun Yew Tham <>,
        Eric Auger <>,
        Greg Kroah-Hartman <>,
        Yoshihiro Shimoda <>,
        Cornelia Huck <>,
        Linux MMC List <>,
        Joakim Zhang <>,
        Linux Kernel Mailing List <>,
        Linux-Renesas <>,
        Vinod Koul <>,
        James Morse <>,
        Zha Qipeng <>,
        Sebastian Reichel <>,
        Niklas Söderlund <>,,
        Brian Norris <>,
        "David S. Miller" <>
Subject: Re: [PATCH] driver core: platform: Rename
 platform_get_irq_optional() to platform_get_irq_silent()

On Thu, Jan 13, 2022 at 11:57:43PM +0300, Sergey Shtylyov wrote:
> On 1/13/22 11:17 PM, Mark Brown wrote:
> >> The subsystems regulator, clk and gpio have the concept of a dummy
> >> resource. For regulator, clk and gpio there is a semantic difference
> >> between the regular _get() function and the _get_optional() variant.
> >> (One might return the dummy resource, the other won't. Unfortunately
> >> which one implements which isn't the same for these three.) The
> >> difference between platform_get_irq() and platform_get_irq_optional() is
> >> only that the former might emit an error message and the later won't.
>    This is only a current difference but I'm still going to return 0 ISO
> -ENXIO from latform_get_irq_optional(), no way I'd leave that -ENXIO there
> alone... :-)

This would address a bit of the critic in my commit log. But as 0 isn't
a dummy value like the dummy values that exist for clk, gpiod and
regulator I still think that the naming is a bad idea because it's not
in the spirit of the other *_get_optional functions.

Seeing you say that -ENXIO is a bad return value for
platform_get_irq_optional() and 0 should be used instead, I wonder why
not changing platform_get_irq() to return 0 instead of -ENXIO, too.
This question is for now only about a sensible semantic. That actually
changing platform_get_irq() is probably harder than changing
platform_get_irq_optional() is a different story.

If only platform_get_irq_optional() is changed and given that the
callers have to do something like:

	if (this_irq_exists()):
		... (e.g. request_irq)
		... (e.g. setup polling)

I really think it's a bad idea that this_irq_exists() has to be
different for platform_get_irq() vs. platform_get_irq_optional().

> > Reviewed-by: Mark Brown <>
>    Hm... I'm seeing a tag bit not seeing the patch itself...


This is just a tree-wide
s/platform_get_irq_optional/platform_get_irq_silent/ + a macro to not
break callers of platform_get_irq_optional().

Best regards

Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists