Skip to content

Commit

Permalink
ARM: remove __bad_xchg definition
Browse files Browse the repository at this point in the history
We want link errors if xchg() is called for a variable size we do not
support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jun 2, 2015
1 parent 45b0fa0 commit 31cd08c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions arch/arm/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
break;
#endif
default:
/* Cause a link-time error, the xchg() size is not supported */
__bad_xchg(ptr, size), ret = 0;
break;
}
Expand Down
8 changes: 0 additions & 8 deletions arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,6 @@ late_initcall(arm_mrc_hook_init);

#endif

void __bad_xchg(volatile void *ptr, int size)
{
pr_err("xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n",
__builtin_return_address(0), ptr, size);
BUG();
}
EXPORT_SYMBOL(__bad_xchg);

/*
* A data abort trap was taken, but we did not handle the instruction.
* Try to abort the user program, or panic if it was the kernel.
Expand Down

0 comments on commit 31cd08c

Please sign in to comment.