Skip to content

Commit

Permalink
x86, mm: fault.c, use printk_once() in is_errata93()
Browse files Browse the repository at this point in the history
Andrew pointed out that the 'once' variable has a needlessly
function-global scope. We can in fact eliminate it completely,
via the use of printk_once().

[ Impact: cleanup ]

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed May 3, 2009
1 parent 9518e0e commit a454ab3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,6 @@ static void dump_pagetable(unsigned long address)
static int is_errata93(struct pt_regs *regs, unsigned long address)
{
#ifdef CONFIG_X86_64
static int once;

if (address != regs->ip)
return 0;

Expand All @@ -525,10 +523,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
address |= 0xffffffffUL << 32;
if ((address >= (u64)_stext && address <= (u64)_etext) ||
(address >= MODULES_VADDR && address <= MODULES_END)) {
if (!once) {
printk(errata93_warning);
once = 1;
}
printk_once(errata93_warning);
regs->ip = address;
return 1;
}
Expand Down

0 comments on commit a454ab3

Please sign in to comment.