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: Thu, 02 May 2024 13:54:36 +0200
From: Nuno Sá <noname.nuno@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 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, 2024-04-23 at 18:45 +0300, Andy Shevchenko wrote:
> On Tue, Apr 23, 2024 at 06:31:20PM +0300, Andy Shevchenko wrote:
> > On Tue, Apr 23, 2024 at 05:20:30PM +0200, Nuno Sa via B4 Relay wrote:
> > > From: Nuno Sa <nuno.sa@...log.com>
> 
> ...
> 
> > > +#define dev_err_cast_probe(dev, ___err_ptr, fmt,
> > > ...)	({			\
> > > +	ERR_PTR(dev_err_probe(dev, PTR_ERR(___err_ptr), fmt,
> > > ##__VA_ARGS__));	\
> > > +})
> 
> After looking into the next patch I think this should be rewritten to use %pe,
> hence should be an exported function. Or dev_err_probe() should be split to
> a version that makes the difference between int and const void * (maybe using
> _Generic()).
> 

I replied a bit in the other patch but I'm of the opinion that's likely just more
complicated than it needs to be (IMO). Why is the PTR_ERR(___err_ptr) that bad? If we
really want to have a version that takes pointer why not just:

#define dev_err_ptr_probe(dev, ___err, fmt, ...) \
	dev_err_probe(dev, PTR_ERR(__err), fmt, ##__VA_ARGS__)


(yes, while _Generic() could be fun I'm trying to avoid it. In this case, I think
having explicit defines is more helpful)

- Nuno Sá

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ