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]
Message-ID: <ZeBe-ubcNvtDdAG6@smile.fi.intel.com>
Date: Thu, 29 Feb 2024 12:39:54 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Philipp Stanner <pstanner@...hat.com>
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
	Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH v1 1/2] devres: Switch to use dev_err_probe() for
 unification

On Thu, Feb 29, 2024 at 09:52:34AM +0100, Philipp Stanner wrote:
> On Tue, 2024-02-27 at 19:58 +0200, Andy Shevchenko wrote:
> > The devm_*() APIs are supposed to be called during the ->probe()
> > stage.
> > Many drivers (especially new ones) has switched to use
> 
> has -> have

Thanks, will fix.

> > dev_err_probe()
> > for error messaging for the sake of unification. Let's do the same in
> > the devres APIs.
> 
> No objections on principle. Just one thing about the implementation:

..

> > +               ret = dev_err_probe(dev, -EINVAL, "invalid resource
> > %pR\n", res);
> > +               return IOMEM_ERR_PTR(ret);
> 
> So as I see it -EINVAL is just piped through dev_err_probe() and is
> never changed.
> Don't you think it would be better to drop variable 'ret' and just do
> return IOMEM_ERR_PTR(-EINVAL);
> as before?

dev_err_probe() requires error code as a parameter. Are you suggesting to have
a duplication?

	dev_err_probe(-EINVAL);
	return -EINVAL;

I don't think it's a good suggestion, so the answer is "No, I don't think it
would be better."

> That way it would be obvious that the error code is never changed and
> it will always return -EINVAL. Otherwise you have to look up the
> function definition of dev_err_probe().

..

> The same would apply below.

Same answer.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ