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: <m163auvylv.fsf@fess.ebiederm.org>
Date:	Mon, 05 Oct 2009 05:01:16 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Joe Perches <joe@...ches.com>
Cc:	linux-kernel@...r.kernel.org, kexec@...ts.infradead.org
Subject: Re: [PATCH 16/21] kernel/kexec.c: use pr_<level> and add pr_fmt(fmt)

Joe Perches <joe@...ches.com> writes:

> Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> Converted printk(KERN_<level> to pr_<level>(
> Added KERN_ERR to allocation failure message

I'm dense and I haven't seen the discussions.  What
is the point of adding a prefix string where none exists
into a bunch of printks?

> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  kernel/kexec.c |   21 ++++++++++-----------
>  1 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index f336e21..e805351 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -6,6 +6,8 @@
>   * Version 2.  See the file COPYING for more details.
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/capability.h>
>  #include <linux/mm.h>
>  #include <linux/file.h>
> @@ -245,13 +247,13 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry,
>  	image->control_code_page = kimage_alloc_control_pages(image,
>  					   get_order(KEXEC_CONTROL_PAGE_SIZE));
>  	if (!image->control_code_page) {
> -		printk(KERN_ERR "Could not allocate control_code_buffer\n");
> +		pr_err("Could not allocate control_code_buffer\n");
>  		goto out;
>  	}
>  
>  	image->swap_page = kimage_alloc_control_pages(image, 0);
>  	if (!image->swap_page) {
> -		printk(KERN_ERR "Could not allocate swap buffer\n");
> +		pr_err("Could not allocate swap buffer\n");
>  		goto out;
>  	}
>  
> @@ -320,7 +322,7 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry,
>  	image->control_code_page = kimage_alloc_control_pages(image,
>  					   get_order(KEXEC_CONTROL_PAGE_SIZE));
>  	if (!image->control_code_page) {
> -		printk(KERN_ERR "Could not allocate control_code_buffer\n");
> +		pr_err("Could not allocate control_code_buffer\n");
>  		goto out;
>  	}
>  
> @@ -1141,8 +1143,7 @@ static int __init crash_notes_memory_init(void)
>  	/* Allocate memory for saving cpu registers. */
>  	crash_notes = alloc_percpu(note_buf_t);
>  	if (!crash_notes) {
> -		printk("Kexec: Memory allocation for saving cpu register"
> -		" states failed\n");
> +		pr_err("Memory allocation for saving cpu register states failed\n");
>  		return -ENOMEM;
>  	}
>  	return 0;
> @@ -1192,8 +1193,7 @@ static int __init parse_crashkernel_mem(char 			*cmdline,
>  		if (*cur != ':') {
>  			end = memparse(cur, &tmp);
>  			if (cur == tmp) {
> -				pr_warning("crashkernel: Memory "
> -						"value expected\n");
> +				pr_warning("crashkernel: Memory value expected\n");
>  				return -EINVAL;
>  			}
>  			cur = tmp;
> @@ -1211,7 +1211,7 @@ static int __init parse_crashkernel_mem(char 			*cmdline,
>  
>  		size = memparse(cur, &tmp);
>  		if (cur == tmp) {
> -			pr_warning("Memory value expected\n");
> +			pr_warning("crashkernel: Memory value expected\n");
>  			return -EINVAL;
>  		}
>  		cur = tmp;
> @@ -1234,8 +1234,7 @@ static int __init parse_crashkernel_mem(char 			*cmdline,
>  			cur++;
>  			*crash_base = memparse(cur, &tmp);
>  			if (cur == tmp) {
> -				pr_warning("Memory value expected "
> -						"after '@'\n");
> +				pr_warning("crashkernel: Memory value expected after '@'\n");
>  				return -EINVAL;
>  			}
>  		}
> @@ -1473,7 +1472,7 @@ int kernel_kexec(void)
>  #endif
>  	{
>  		kernel_restart_prepare(NULL);
> -		printk(KERN_EMERG "Starting new kernel\n");
> +		pr_emerg("Starting new kernel\n");
>  		machine_shutdown();
>  	}
>  
> -- 
> 1.6.3.1.10.g659a0.dirty
>
> --
> 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/
--
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