Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4df9e510 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Ingo Molnar
Browse files

x86: coding style fixes to arch/x86/kernel/traps_64.c



Fix all errors and many warnings reported by checkpath.pl.
Except the change of include <asm/io.h> to <linux/io.h>
the traps.o before and after changes are the same.

Signed-off-by: default avatarGustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent caa007dd
Loading
Loading
Loading
Loading
+32 −27
Original line number Original line Diff line number Diff line
@@ -32,6 +32,8 @@
#include <linux/bug.h>
#include <linux/bug.h>
#include <linux/nmi.h>
#include <linux/nmi.h>
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/io.h>


#if defined(CONFIG_EDAC)
#if defined(CONFIG_EDAC)
#include <linux/edac.h>
#include <linux/edac.h>
@@ -45,9 +47,6 @@
#include <asm/unwind.h>
#include <asm/unwind.h>
#include <asm/desc.h>
#include <asm/desc.h>
#include <asm/i387.h>
#include <asm/i387.h>
#include <asm/nmi.h>
#include <asm/smp.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
#include <asm/pgalloc.h>
#include <asm/proto.h>
#include <asm/proto.h>
#include <asm/pda.h>
#include <asm/pda.h>
@@ -85,7 +84,8 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)


void printk_address(unsigned long address, int reliable)
void printk_address(unsigned long address, int reliable)
{
{
	printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address);
	printk(" [<%016lx>] %s%pS\n", address, reliable ?
			"" : "? ", (void *) address);
}
}


static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
@@ -98,7 +98,8 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
		[STACKFAULT_STACK - 1] = "#SS",
		[STACKFAULT_STACK - 1] = "#SS",
		[MCE_STACK - 1] = "#MC",
		[MCE_STACK - 1] = "#MC",
#if DEBUG_STKSZ > EXCEPTION_STKSZ
#if DEBUG_STKSZ > EXCEPTION_STKSZ
		[N_EXCEPTION_STACKS ... N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
		[N_EXCEPTION_STACKS ... N_EXCEPTION_STACKS + DEBUG_STKSZ /
			EXCEPTION_STKSZ - 2] = "#DB[?]"
#endif
#endif
	};
	};
	unsigned k;
	unsigned k;
@@ -357,11 +358,13 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
	unsigned long *stack;
	unsigned long *stack;
	int i;
	int i;
	const int cpu = smp_processor_id();
	const int cpu = smp_processor_id();
	unsigned long *irqstack_end = (unsigned long *) (cpu_pda(cpu)->irqstackptr);
	unsigned long *irqstack_end =
	unsigned long *irqstack = (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE);
		(unsigned long *) (cpu_pda(cpu)->irqstackptr);
	unsigned long *irqstack =
		(unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE);


	// debugging aid: "show_stack(NULL, NULL);" prints the
	/* debugging aid: "show_stack(NULL, NULL);" prints the
	// back trace for this cpu.
	  back trace for this cpu. */


	if (sp == NULL) {
	if (sp == NULL) {
		if (task)
		if (task)
@@ -414,7 +417,6 @@ void dump_stack(void)
		init_utsname()->version);
		init_utsname()->version);
	show_trace(NULL, NULL, &stack, bp);
	show_trace(NULL, NULL, &stack, bp);
}
}

EXPORT_SYMBOL(dump_stack);
EXPORT_SYMBOL(dump_stack);


void show_registers(struct pt_regs *regs)
void show_registers(struct pt_regs *regs)
@@ -780,7 +782,8 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
static notrace __kprobes void
static notrace __kprobes void
unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
{
{
	if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
	if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) ==
			NOTIFY_STOP)
		return;
		return;
	printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
	printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
		reason);
		reason);
@@ -1142,8 +1145,10 @@ void __init trap_init(void)
	set_intr_gate(0, &divide_error);
	set_intr_gate(0, &divide_error);
	set_intr_gate_ist(1, &debug, DEBUG_STACK);
	set_intr_gate_ist(1, &debug, DEBUG_STACK);
	set_intr_gate_ist(2, &nmi, NMI_STACK);
	set_intr_gate_ist(2, &nmi, NMI_STACK);
 	set_system_gate_ist(3, &int3, DEBUG_STACK); /* int3 can be called from all */
	/* int3 can be called from all */
	set_system_gate(4, &overflow); /* int4 can be called from all */
	set_system_gate_ist(3, &int3, DEBUG_STACK);
	/* int4 can be called from all */
	set_system_gate(4, &overflow);
	set_intr_gate(5, &bounds);
	set_intr_gate(5, &bounds);
	set_intr_gate(6, &invalid_op);
	set_intr_gate(6, &invalid_op);
	set_intr_gate(7, &device_not_available);
	set_intr_gate(7, &device_not_available);