mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
sh: use __builtin_constant_p() directly instead of IS_IMMEDIATE()
__builtin_constant_p(nr) is used everywhere now. It does not make much sense to define IS_IMMEDIATE() as its alias. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
f5e94d10e4
commit
e3c0f6f3fb
@ -16,11 +16,9 @@
|
|||||||
#define BYTE_OFFSET(nr) ((nr) % BITS_PER_BYTE)
|
#define BYTE_OFFSET(nr) ((nr) % BITS_PER_BYTE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr))
|
|
||||||
|
|
||||||
static inline void __set_bit(int nr, volatile unsigned long *addr)
|
static inline void __set_bit(int nr, volatile unsigned long *addr)
|
||||||
{
|
{
|
||||||
if (IS_IMMEDIATE(nr)) {
|
if (__builtin_constant_p(nr)) {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"bset.b %1, @(%O2,%0) ! __set_bit\n\t"
|
"bset.b %1, @(%O2,%0) ! __set_bit\n\t"
|
||||||
: "+r" (addr)
|
: "+r" (addr)
|
||||||
@ -37,7 +35,7 @@ static inline void __set_bit(int nr, volatile unsigned long *addr)
|
|||||||
|
|
||||||
static inline void __clear_bit(int nr, volatile unsigned long *addr)
|
static inline void __clear_bit(int nr, volatile unsigned long *addr)
|
||||||
{
|
{
|
||||||
if (IS_IMMEDIATE(nr)) {
|
if (__builtin_constant_p(nr)) {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"bclr.b %1, @(%O2,%0) ! __clear_bit\n\t"
|
"bclr.b %1, @(%O2,%0) ! __clear_bit\n\t"
|
||||||
: "+r" (addr)
|
: "+r" (addr)
|
||||||
@ -64,7 +62,7 @@ static inline void __clear_bit(int nr, volatile unsigned long *addr)
|
|||||||
*/
|
*/
|
||||||
static inline void __change_bit(int nr, volatile unsigned long *addr)
|
static inline void __change_bit(int nr, volatile unsigned long *addr)
|
||||||
{
|
{
|
||||||
if (IS_IMMEDIATE(nr)) {
|
if (__builtin_constant_p(nr)) {
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"bxor.b %1, @(%O2,%0) ! __change_bit\n\t"
|
"bxor.b %1, @(%O2,%0) ! __change_bit\n\t"
|
||||||
: "+r" (addr)
|
: "+r" (addr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user