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

Commit b8030906 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86: dumpstack: Clean up the x86_stack_ids[][] initalization and other details



Make the initialization more readable, plus tidy up a few small
visual details as well.

No change in functionality.

LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 27c13ece
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -10,9 +10,9 @@
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/kexec.h>
#include <linux/sysfs.h>
#include <linux/bug.h>
#include <linux/nmi.h>
#include <linux/sysfs.h>

#include <asm/stacktrace.h>

@@ -35,6 +35,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,

	if (!stack) {
		unsigned long dummy;

		stack = &dummy;
		if (task && task != current)
			stack = (unsigned long *)task->thread.sp;
@@ -57,8 +58,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,

		context = (struct thread_info *)
			((unsigned long)stack & (~(THREAD_SIZE - 1)));
		bp = print_context_stack(context, stack, bp, ops,
					 data, NULL, &graph);
		bp = print_context_stack(context, stack, bp, ops, data, NULL, &graph);

		stack = (unsigned long *)context->previous_esp;
		if (!stack)
@@ -156,4 +156,3 @@ int is_valid_bugaddr(unsigned long ip)

	return ud2 == 0x0b0f;
}
+13 −12
Original line number Diff line number Diff line
@@ -10,14 +10,16 @@
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/kexec.h>
#include <linux/sysfs.h>
#include <linux/bug.h>
#include <linux/nmi.h>
#include <linux/sysfs.h>

#include <asm/stacktrace.h>

#include "dumpstack.h"

#define N_EXCEPTION_STACKS_END \
		(N_EXCEPTION_STACKS + DEBUG_STKSZ/EXCEPTION_STKSZ - 2)

static char x86_stack_ids[][8] = {
		[ DEBUG_STACK-1			]	= "#DB",
@@ -27,7 +29,7 @@ static char x86_stack_ids[][8] = {
		[ MCE_STACK-1			]	= "#MC",
#if DEBUG_STKSZ > EXCEPTION_STKSZ
		[ N_EXCEPTION_STACKS ...
			N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
		  N_EXCEPTION_STACKS_END	]	= "#DB[?]"
#endif
};

@@ -303,4 +305,3 @@ int is_valid_bugaddr(unsigned long ip)

	return ud2 == 0x0b0f;
}