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]
Date: Tue, 23 Apr 2024 18:31:20 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: nuno.sa@...log.com
Cc: Petr Mladek <pmladek@...e.com>, Chris Down <chris@...isdown.name>,
	John Ogness <john.ogness@...utronix.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jonathan Cameron <jic23@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Olivier Moysan <olivier.moysan@...s.st.com>,
	Andi Shyti <andi.shyti@...nel.org>,
	Jyoti Bhayana <jbhayana@...gle.com>, linux-kernel@...r.kernel.org,
	linux-iio@...r.kernel.org
Subject: Re: [PATCH v2 1/4] dev_printk: add new dev_err_probe() helpers

On Tue, Apr 23, 2024 at 05:20:30PM +0200, Nuno Sa via B4 Relay wrote:
> From: Nuno Sa <nuno.sa@...log.com>
> 
> This is similar to dev_err_probe() but for cases where an ERR_PTR() or
> ERR_CAST() is to be returned simplifying patterns like:
> 
> 	dev_err_probe(dev, ret, ...);
> 	return ERR_PTR(ret)
> or
> 	dev_err_probe(dev, PTR_ERR(ptr), ...);
> 	return ERR_CAST(ptr)

..

> +/* Simple helper for dev_err_probe() when ERR_PTR() is to be returned. */
> +#define dev_err_ptr_probe(dev, ___err, fmt, ...)	({		\
> +	ERR_PTR(dev_err_probe(dev, ___err, fmt, ##__VA_ARGS__));	\
> +})

Why ; and hence why ({}) ?

I even believe the compiler may warn if you have double ;; in some cases.

..

> +#define dev_err_cast_probe(dev, ___err_ptr, fmt, ...)	({			\
> +	ERR_PTR(dev_err_probe(dev, PTR_ERR(___err_ptr), fmt, ##__VA_ARGS__));	\
> +})

Ditto.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ