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: <3c709cc1-0da8-4d23-9f75-8c18d4d18779@roeck-us.net>
Date:   Fri, 1 Dec 2023 08:01:28 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org
Cc:     Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
        Dwaipayan Ray <dwaipayanray1@...il.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH v1 1/1] checkpatch: Add dev_err_probe() to the list of Log
 Functions

On 12/1/23 07:14, Andy Shevchenko wrote:
> dev_err_probe() is missing in the list of Log Functions and hence
> checkpatch issues a warning in the cases when any other function
> in use won't trigger it. Add dev_err_probe() to the list to behave
> consistently.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>   scripts/checkpatch.pl | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a94ed6c46a6d..c40f3f784f7e 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -593,6 +593,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
>   our $logFunctions = qr{(?x:
>   	printk(?:_ratelimited|_once|_deferred_once|_deferred|)|
>   	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
> +	dev_err_probe|
>   	TP_printk|
>   	WARN(?:_RATELIMIT|_ONCE|)|
>   	panic|


Not sure if I agree. The difference here is that dev_err_probe()
has two additional parameters ahead of the string. I would very much prefer
to have those two additional parameters on a separate line if the string is
too long to fit in 100 columns with those two parameters on the same line.
In other words, I very much prefer

	dev_err_probe(dev, -ESOMETHING,
		      "very long string");
over
	dev_err_probe(dev, -ESOMETHING, "very long string");

and I don't really think that the latter has any benefits.

Also note that other dev_xxx() log functions are not included in the above test
and would still generate warnings. Accepting

	dev_err_probe(dev, -ESOMETHING, "very long string");
but not
	dev_err(dev, "very long string");

doesn't really make sense to me.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ