Skip to content

Commit

Permalink
[PATCH] x86_64: Clean up white space in traps.c
Browse files Browse the repository at this point in the history
Attached is a small code style cleanup patch that resulted from my
skimming through the arch/x86_64/kernel/traps.c code to figure out what
went haywire.

Signed-off-by: Roberto Nibali <ratz@drugphish.ch>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Roberto Nibali authored and Linus Torvalds committed Mar 25, 2006
1 parent b2b978f commit 2b692a8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int printk_address(unsigned long address)
if (!modname)
modname = delim = "";
return printk("<%016lx>{%s%s%s%s%+ld}",
address,delim,modname,delim,symname,offset);
address, delim, modname, delim, symname, offset);
}
#else
int printk_address(unsigned long address)
Expand Down Expand Up @@ -336,13 +336,12 @@ void show_registers(struct pt_regs *regs)
show_stack(NULL, (unsigned long*)rsp);

printk("\nCode: ");
if(regs->rip < PAGE_OFFSET)
if (regs->rip < PAGE_OFFSET)
goto bad;

for(i=0;i<20;i++)
{
for (i=0; i<20; i++) {
unsigned char c;
if(__get_user(c, &((unsigned char*)regs->rip)[i])) {
if (__get_user(c, &((unsigned char*)regs->rip)[i])) {
bad:
printk(" Bad RIP value.");
break;
Expand Down Expand Up @@ -481,7 +480,7 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
printk(KERN_INFO
"%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
tsk->comm, tsk->pid, str,
regs->rip,regs->rsp,error_code);
regs->rip, regs->rsp, error_code);

if (info)
force_sig_info(signr, info, tsk);
Expand All @@ -495,9 +494,9 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
{
const struct exception_table_entry *fixup;
fixup = search_exception_tables(regs->rip);
if (fixup) {
if (fixup)
regs->rip = fixup->fixup;
} else
else
die(str, regs, error_code);
return;
}
Expand Down Expand Up @@ -570,7 +569,7 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
printk(KERN_INFO
"%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
tsk->comm, tsk->pid,
regs->rip,regs->rsp,error_code);
regs->rip, regs->rsp, error_code);

force_sig(SIGSEGV, tsk);
return;
Expand Down

0 comments on commit 2b692a8

Please sign in to comment.