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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231214102645.xrbcbfc5hks6kltv@pengutronix.de>
Date:   Thu, 14 Dec 2023 11:26:45 +0100
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Nikita Shubin <nikita.shubin@...uefel.me>,
        Hartley Sweeten <hsweeten@...ionengravers.com>,
        Alexander Sverdlin <alexander.sverdlin@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Sergey Shtylyov <s.shtylyov@....ru>,
        Damien Le Moal <dlemoal@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-ide@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v6 36/40] ata: pata_ep93xx: remove legacy pinctrl use

On Wed, Dec 13, 2023 at 08:48:55PM +0200, Andy Shevchenko wrote:
> On Wed, Dec 13, 2023 at 07:33:49PM +0100, Uwe Kleine-König wrote:
> > On Wed, Dec 13, 2023 at 08:16:26PM +0200, Andy Shevchenko wrote:
> > > On Tue, Dec 12, 2023 at 11:20:53AM +0300, Nikita Shubin wrote:
> > > > Drop legacy acquire/release since we are using pinctrl for this now.
> 
> ...
> 
> > > I think you wanted
> > > 
> > > 	ret = PTR_ERR_OR_ZERO(drv_data->dma_rx_channel);
> > > 	if (ret)
> > > 		return dev_err_probe(dev, ret, "rx DMA setup failed");
> > 
> > How is that different from
> > 
> > 	if (IS_ERR(drv_data->dma_rx_channel))
> > 		return dev_err_probe(dev, PTR_ERR(drv_data->dma_rx_channel), "....");
> > 
> > (which seems to be more idiomatic to me)? While I was involved in
> > creating PTR_ERR_OR_ZERO, I don't particularily like it (today).
> 
> Makes lines shorter, either works for me.

If you want shorter lines, I'd prefer

	if (IS_ERR(drv_data->dma_rx_channel)) {
		ret = PTR_ERR(drv_data->dma_rx_channel);
		return dev_err_probe(dev, ret, "...\n");
	}

over
	ret = PTR_ERR_OR_ZERO(drv_data->dma_rx_channel);
	if (ret)
		return dev_err_probe(dev, ret, "\n");

even though it's one line longer because the if body needs curly braces.
I think it's easier to parse for a human which IMHO matters more than
the additional line. But I'm aware that might be subjective.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ