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: <20130103100808.GG2649@dm>
Date:	Thu, 3 Jan 2013 10:08:08 +0000
From:	Andy Whitcroft <apw@...onical.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Lance Ortiz <lance.ortiz@...com>, bhelgaas@...gle.com,
	lance_ortiz@...mail.com, jiang.liu@...wei.com, tony.luck@...el.com,
	bp@...en8.de, rostedt@...dmis.org, mchehab@...hat.com,
	linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: prefer dev_<level>( to
 dev_printk(KERN_<LEVEL>

On Wed, Jan 02, 2013 at 04:06:34PM -0800, Joe Perches wrote:
> Add YA check to printk style.
> 
> dev_<level> uses are functions and generate smaller
> object code than dev_printk(KERN_<LEVEL>.
> 
> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  scripts/checkpatch.pl | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4d2c7df..f50b32d 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2430,6 +2430,16 @@ sub process {
>  			     "Prefer pr_warn(... to pr_warning(...\n" . $herecurr);
>  		}
>  
> +		if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
> +			my $orig = $1;
> +			my $level = lc($orig);
> +			$level = "warn" if ($level eq "warning");
> +			my $level2 = $level;
> +			$level2 = "dbg" if ($level eq "debug");

Is there some sublty I am not seeing here such that level2 is necessary?
As far as I can see the two above could be the below to the same effect?

			$level2= "dbg" if ($level eq "debug");

(With the obvious change to the print of course)

-apw
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ