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: <434ca0ab-1c9b-5c4f-c844-5e792725f9ab@redhat.com>
Date:   Fri, 28 Aug 2020 11:22:25 -0700
From:   Tom Rix <trix@...hat.com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Andrzej Hajda <a.hajda@...sung.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Mark Brown <broonie@...nel.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] driver code: print symbolic error code


On 8/28/20 9:14 AM, Michał Mirosław wrote:
> dev_err_probe() prepends the message with an error code. Let's make it
> more readable by translating the code to a more recognisable symbol.
recognizable
>
> Fixes: a787e5400a1c ("driver core: add device probe log helper")
is this change really to fix a bug?
> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> ---
>  drivers/base/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index ac1046a382bc..1a4706310b28 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -4237,10 +4237,10 @@ int dev_err_probe(const struct device *dev, int err, const char *fmt, ...)
>  	vaf.va = &args;
>  
>  	if (err != -EPROBE_DEFER) {
> -		dev_err(dev, "error %d: %pV", err, &vaf);
> +		dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
>  	} else {
>  		device_set_deferred_probe_reason(dev, &vaf);
> -		dev_dbg(dev, "error %d: %pV", err, &vaf);
> +		dev_dbg(dev, "error %pe: %pV", ERR_PTR(err), &vaf);

Should just use '-EPROBE_DEFER' directly instead of making printk do it.

or maybe reduce the original if-else to an just an if

if (err == -EPROBE_DEFER)

    device_set_deferred_probe_reason(...

dev_dbg(dev, "error %pe ...

Tom

>  	}
>  
>  	va_end(args);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ