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

On Thu, 6 Jun 2024 09:22:37 +0200
Nuno Sa <nuno.sa@...log.com> wrote:

> 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)
> 
> Signed-off-by: Nuno Sa <nuno.sa@...log.com>

I'm convinced this is worth doing but would like inputs from others
before I pick this series up.

Jonathan

> ---
>  include/linux/dev_printk.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/dev_printk.h b/include/linux/dev_printk.h
> index ae80a303c216..ca32b5bb28eb 100644
> --- a/include/linux/dev_printk.h
> +++ b/include/linux/dev_printk.h
> @@ -277,4 +277,12 @@ do {									\
>  
>  __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
>  
> +/* 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__))
> +
> +/* Simple helper for dev_err_probe() when ERR_CAST() is to be returned. */
> +#define dev_err_cast_probe(dev, ___err_ptr, fmt, ...) \
> +	ERR_PTR(dev_err_probe(dev, PTR_ERR(___err_ptr), fmt, ##__VA_ARGS__))
> +
>  #endif /* _DEVICE_PRINTK_H_ */
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ