public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/7] arm64: Use pr_* instead of printk
@ 2014-04-29  4:59 Jungseok Lee
  2014-04-29 20:35 ` Mitchel Humpherys
  0 siblings, 1 reply; 3+ messages in thread
From: Jungseok Lee @ 2014-04-29  4:59 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, Catalin.Marinas, Marc Zyngier,
	Christoffer Dall
  Cc: linux-kernel, linux-samsung-soc, steve.capper, sungjinn.chung,
	Arnd Bergmann, kgene.kim, ilho215.lee

This patch fixed the following checkpatch complaint as using pr_*
instead of printk.

WARNING: printk() should include KERN_ facility level

Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jungseok Lee <jays.lee@samsung.com>
Reviewed-by: Sungjinn Chung <sungjinn.chung@samsung.com>
---
 arch/arm64/kernel/traps.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 7ffaddd..0484e81 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -65,7 +65,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	printk("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);
+	pr_emerg("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);
 
 	for (first = bottom & ~31; first < top; first += 32) {
 		unsigned long p;
@@ -83,7 +83,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
 					sprintf(str + i * 9, " ????????");
 			}
 		}
-		printk("%s%04lx:%s\n", lvl, first & 0xffff, str);
+		pr_emerg("%s%04lx:%s\n", lvl, first & 0xffff, str);
 	}
 
 	set_fs(fs);
@@ -124,7 +124,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
 			break;
 		}
 	}
-	printk("%sCode: %s\n", lvl, str);
+	pr_emerg("%sCode: %s\n", lvl, str);
 
 	set_fs(fs);
 }
@@ -156,7 +156,7 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
 		frame.pc = thread_saved_pc(tsk);
 	}
 
-	printk("Call trace:\n");
+	pr_emerg("Call trace:\n");
 	while (1) {
 		unsigned long where = frame.pc;
 		int ret;
@@ -328,17 +328,17 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
 
 void __pte_error(const char *file, int line, unsigned long val)
 {
-	printk("%s:%d: bad pte %016lx.\n", file, line, val);
+	pr_crit("%s:%d: bad pte %016lx.\n", file, line, val);
 }
 
 void __pmd_error(const char *file, int line, unsigned long val)
 {
-	printk("%s:%d: bad pmd %016lx.\n", file, line, val);
+	pr_crit("%s:%d: bad pmd %016lx.\n", file, line, val);
 }
 
 void __pgd_error(const char *file, int line, unsigned long val)
 {
-	printk("%s:%d: bad pgd %016lx.\n", file, line, val);
+	pr_crit("%s:%d: bad pgd %016lx.\n", file, line, val);
 }
 
 void __init trap_init(void)
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 1/7] arm64: Use pr_* instead of printk
  2014-04-29  4:59 [PATCH v4 1/7] arm64: Use pr_* instead of printk Jungseok Lee
@ 2014-04-29 20:35 ` Mitchel Humpherys
  2014-04-30  2:32   ` Jungseok Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Mitchel Humpherys @ 2014-04-29 20:35 UTC (permalink / raw)
  To: Jungseok Lee
  Cc: linux-arm-kernel, kvmarm, Catalin.Marinas, Marc Zyngier,
	Christoffer Dall, kgene.kim, steve.capper, Arnd Bergmann,
	linux-kernel, ilho215.lee, linux-samsung-soc, sungjinn.chung

On Mon, Apr 28 2014 at 09:59:14 PM, Jungseok Lee <jays.lee@samsung.com> wrote:
> This patch fixed the following checkpatch complaint as using pr_*
> instead of printk.
>
> WARNING: printk() should include KERN_ facility level
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Jungseok Lee <jays.lee@samsung.com>
> Reviewed-by: Sungjinn Chung <sungjinn.chung@samsung.com>
> ---
>  arch/arm64/kernel/traps.c |   14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 7ffaddd..0484e81 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -65,7 +65,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
>  	fs = get_fs();
>  	set_fs(KERNEL_DS);
>  
> -	printk("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);
> +	pr_emerg("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);

Currently this printk is being called with lvl=KERN_EMERG or lvl="". In
the case of lvl=KERN_EMERG leaving lvl in is redundant. In the case of
lvl="" this is a behavioral change (printing to a different log
level). Was this intended?

>  
>  	for (first = bottom & ~31; first < top; first += 32) {
>  		unsigned long p;
> @@ -83,7 +83,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
>  					sprintf(str + i * 9, " ????????");
>  			}
>  		}
> -		printk("%s%04lx:%s\n", lvl, first & 0xffff, str);
> +		pr_emerg("%s%04lx:%s\n", lvl, first & 0xffff, str);

Ditto

>  	}
>  
>  	set_fs(fs);
> @@ -124,7 +124,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
>  			break;
>  		}
>  	}
> -	printk("%sCode: %s\n", lvl, str);
> +	pr_emerg("%sCode: %s\n", lvl, str);

Ditto. Also called with with lvl=KERN_INFO.


Mitch

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 1/7] arm64: Use pr_* instead of printk
  2014-04-29 20:35 ` Mitchel Humpherys
@ 2014-04-30  2:32   ` Jungseok Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Jungseok Lee @ 2014-04-30  2:32 UTC (permalink / raw)
  To: 'Mitchel Humpherys'
  Cc: linux-arm-kernel, kvmarm, Catalin.Marinas, 'Marc Zyngier',
	'Christoffer Dall', kgene.kim, steve.capper,
	'Arnd Bergmann', linux-kernel, ilho215.lee,
	'linux-samsung-soc', sungjinn.chung

On Wednesday, April 30, 2014 5:35 AM, Mitchel Humpherys wrote:
> On Mon, Apr 28 2014 at 09:59:14 PM, Jungseok Lee <jays.lee@samsung.com> wrote:
> > This patch fixed the following checkpatch complaint as using pr_*
> > instead of printk.
> >
> > WARNING: printk() should include KERN_ facility level
> >
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Signed-off-by: Jungseok Lee <jays.lee@samsung.com>
> > Reviewed-by: Sungjinn Chung <sungjinn.chung@samsung.com>
> > ---
> >  arch/arm64/kernel/traps.c |   14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> > index 7ffaddd..0484e81 100644
> > --- a/arch/arm64/kernel/traps.c
> > +++ b/arch/arm64/kernel/traps.c
> > @@ -65,7 +65,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
> >  	fs = get_fs();
> >  	set_fs(KERNEL_DS);
> >
> > -	printk("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);
> > +	pr_emerg("%s%s(0x%016lx to 0x%016lx)\n", lvl, str, bottom, top);
> 
> Currently this printk is being called with lvl=KERN_EMERG or lvl="". In the case of lvl=KERN_EMERG
> leaving lvl in is redundant. In the case of lvl="" this is a behavioral change (printing to a
> different log level). Was this intended?

No intention. I will drop the change in the next version.
Thanks!!

Best Regards
Jungseok Lee


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-30  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  4:59 [PATCH v4 1/7] arm64: Use pr_* instead of printk Jungseok Lee
2014-04-29 20:35 ` Mitchel Humpherys
2014-04-30  2:32   ` Jungseok Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox