* [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-08-28 14:55 ` chengang
0 siblings, 0 replies; 16+ messages in thread
From: chengang @ 2016-08-28 14:55 UTC (permalink / raw)
To: akpm
Cc: minchan, vbabka, gi-oh.kim, iamjoonsoo.kim, hillf.zj, mgorman,
mhocko, rientjes, linux-kernel, rth, ink, mattst88, vgupta,
linux, catalin.marinas, will.deacon, hskinnemoen, egtvedt,
realmz6, ysato, rkuo, tony.luck, fenghua.yu, geert, james.hogan,
ralf, dhowells, deller, benh, paulus, mpe, schwidefsky,
heiko.carstens, dalias, davem, cmetcalf, chris, jcmvbkbc, arnd,
noamc, brueckner, mingo, peterz, linux-arch, Chen Gang
From: Chen Gang <gang.chen.5i5j@gmail.com>
Also use the same changing to asm-generic, and also use bool variable
instead of int variable for mips, mn10300, parisc and tile related
functions, and also avoid checkpatch.pl to report ERROR.
Include linux/types.h for alpha, arm, arm64, m68k, and openrisc to pass
building.
Originally, except powerpc and xtensa, all another architectures intend
to return 0 or 1. After this patch, also let powerpc and xtensa return 0
or 1.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
arch/alpha/include/asm/bitops.h | 17 +++++++++--------
arch/arc/include/asm/bitops.h | 10 +++++-----
arch/arm/include/asm/bitops.h | 13 +++++++------
arch/arm64/include/asm/bitops.h | 7 ++++---
arch/avr32/include/asm/bitops.h | 6 +++---
arch/blackfin/include/asm/bitops.h | 16 ++++++++--------
arch/frv/include/asm/bitops.h | 16 ++++++++--------
arch/h8300/include/asm/bitops.h | 4 ++--
arch/hexagon/include/asm/bitops.h | 14 +++++++-------
arch/ia64/include/asm/bitops.h | 14 +++++++-------
arch/m32r/include/asm/bitops.h | 6 +++---
arch/m68k/include/asm/bitops.h | 21 +++++++++++----------
arch/metag/include/asm/bitops.h | 6 +++---
arch/mips/include/asm/bitops.h | 16 ++++++++--------
arch/mips/lib/bitops.c | 16 ++++++++--------
arch/mn10300/include/asm/bitops.h | 7 ++++---
arch/openrisc/include/asm/bitops.h | 1 +
arch/parisc/include/asm/bitops.h | 16 ++++++++--------
arch/powerpc/include/asm/bitops.h | 10 +++++-----
arch/s390/include/asm/bitops.h | 18 +++++++++---------
arch/sh/include/asm/bitops-cas.h | 6 +++---
arch/sh/include/asm/bitops-grb.h | 6 +++---
arch/sh/include/asm/bitops-llsc.h | 6 +++---
arch/sh/include/asm/bitops-op32.h | 8 ++++----
arch/sparc/include/asm/bitops_32.h | 6 +++---
arch/sparc/include/asm/bitops_64.h | 6 +++---
arch/tile/include/asm/bitops_32.h | 6 +++---
arch/tile/include/asm/bitops_64.h | 10 +++++-----
arch/xtensa/include/asm/bitops.h | 6 +++---
include/asm-generic/bitops/atomic.h | 6 +++---
include/asm-generic/bitops/le.h | 10 +++++-----
include/asm-generic/bitops/non-atomic.h | 8 ++++----
32 files changed, 162 insertions(+), 156 deletions(-)
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 4bdfbd4..789b2bb 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -6,6 +6,7 @@
#endif
#include <asm/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
/*
@@ -125,7 +126,7 @@ __change_bit(unsigned long nr, volatile void * addr)
*m ^= 1 << (nr & 31);
}
-static inline int
+static inline bool
test_and_set_bit(unsigned long nr, volatile void *addr)
{
unsigned long oldbit;
@@ -155,7 +156,7 @@ test_and_set_bit(unsigned long nr, volatile void *addr)
return oldbit != 0;
}
-static inline int
+static inline bool
test_and_set_bit_lock(unsigned long nr, volatile void *addr)
{
unsigned long oldbit;
@@ -185,7 +186,7 @@ test_and_set_bit_lock(unsigned long nr, volatile void *addr)
/*
* WARNING: non atomic version.
*/
-static inline int
+static inline bool
__test_and_set_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -196,7 +197,7 @@ __test_and_set_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned long nr, volatile void * addr)
{
unsigned long oldbit;
@@ -229,7 +230,7 @@ test_and_clear_bit(unsigned long nr, volatile void * addr)
/*
* WARNING: non atomic version.
*/
-static inline int
+static inline bool
__test_and_clear_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -240,7 +241,7 @@ __test_and_clear_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned long nr, volatile void * addr)
{
unsigned long oldbit;
@@ -271,7 +272,7 @@ test_and_change_bit(unsigned long nr, volatile void * addr)
/*
* WARNING: non atomic version.
*/
-static __inline__ int
+static __inline__ bool
__test_and_change_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -282,7 +283,7 @@ __test_and_change_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_bit(int nr, const volatile void * addr)
{
return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h
index 8da87fee..e1976ab 100644
--- a/arch/arc/include/asm/bitops.h
+++ b/arch/arc/include/asm/bitops.h
@@ -60,7 +60,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
* and the old value of bit is returned
*/
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old, temp; \
\
@@ -124,7 +124,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
}
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old, flags; \
m += nr >> 5; \
@@ -160,7 +160,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
}
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old; \
\
@@ -204,7 +204,7 @@ static inline void __##op##_bit(unsigned long nr, volatile unsigned long *m) \
}
#define __TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int __test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool __test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old; \
m += nr >> 5; \
@@ -242,7 +242,7 @@ BIT_OPS(change, ^, CTOP_INST_AXOR_DI_R2_R2_R3)
/*
* This routine doesn't need to be atomic.
*/
-static inline int
+static inline bool
test_bit(unsigned int nr, const volatile unsigned long *addr)
{
unsigned long mask;
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index e943e6c..196bf2d 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -24,6 +24,7 @@
#endif
#include <linux/compiler.h>
+#include <linux/types.h>
#include <linux/irqflags.h>
#include <asm/barrier.h>
@@ -68,7 +69,7 @@ static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned lon
raw_local_irq_restore(flags);
}
-static inline int
+static inline bool
____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -85,7 +86,7 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return (res & mask) != 0;
}
-static inline int
+static inline bool
____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -102,7 +103,7 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
return (res & mask) != 0;
}
-static inline int
+static inline bool
____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -152,9 +153,9 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
extern void _set_bit(int nr, volatile unsigned long * p);
extern void _clear_bit(int nr, volatile unsigned long * p);
extern void _change_bit(int nr, volatile unsigned long * p);
-extern int _test_and_set_bit(int nr, volatile unsigned long * p);
-extern int _test_and_clear_bit(int nr, volatile unsigned long * p);
-extern int _test_and_change_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_set_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_clear_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_change_bit(int nr, volatile unsigned long * p);
/*
* Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
diff --git a/arch/arm64/include/asm/bitops.h b/arch/arm64/include/asm/bitops.h
index 9c19594..1a94dc2 100644
--- a/arch/arm64/include/asm/bitops.h
+++ b/arch/arm64/include/asm/bitops.h
@@ -17,6 +17,7 @@
#define __ASM_BITOPS_H
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
#ifndef _LINUX_BITOPS_H
@@ -29,9 +30,9 @@
extern void set_bit(int nr, volatile unsigned long *p);
extern void clear_bit(int nr, volatile unsigned long *p);
extern void change_bit(int nr, volatile unsigned long *p);
-extern int test_and_set_bit(int nr, volatile unsigned long *p);
-extern int test_and_clear_bit(int nr, volatile unsigned long *p);
-extern int test_and_change_bit(int nr, volatile unsigned long *p);
+extern bool test_and_set_bit(int nr, volatile unsigned long *p);
+extern bool test_and_clear_bit(int nr, volatile unsigned long *p);
+extern bool test_and_change_bit(int nr, volatile unsigned long *p);
#include <asm-generic/bitops/builtin-__ffs.h>
#include <asm-generic/bitops/builtin-ffs.h>
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 910d537..0e3e08b 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -128,7 +128,7 @@ static inline void change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(int nr, volatile void * addr)
+static inline bool test_and_set_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
@@ -168,7 +168,7 @@ static inline int test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(int nr, volatile void * addr)
+static inline bool test_and_clear_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
@@ -209,7 +209,7 @@ static inline int test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(int nr, volatile void * addr)
+static inline bool test_and_change_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index b298b65..ff43a11 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -47,13 +47,13 @@ asmlinkage int __raw_bit_clear_asm(volatile unsigned long *addr, int nr);
asmlinkage int __raw_bit_toggle_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_set_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_set_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_clear_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_clear_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_toggle_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_toggle_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_asm(const volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_asm(const volatile unsigned long *addr, int nr);
static inline void set_bit(int nr, volatile unsigned long *addr)
{
@@ -73,25 +73,25 @@ static inline void change_bit(int nr, volatile unsigned long *addr)
__raw_bit_toggle_asm(a, nr & 0x1f);
}
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
volatile const unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_asm(a, nr & 0x1f) != 0;
}
-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_set_asm(a, nr & 0x1f);
}
-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_clear_asm(a, nr & 0x1f);
}
-static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_toggle_asm(a, nr & 0x1f);
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 0df8e95..c9bf93d 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -27,7 +27,7 @@
#include <asm/atomic.h>
-static inline int test_and_clear_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_clear_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -35,7 +35,7 @@ static inline int test_and_clear_bit(unsigned long nr, volatile void *addr)
return (__atomic32_fetch_and(~mask, ptr) & mask) != 0;
}
-static inline int test_and_set_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_set_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -43,7 +43,7 @@ static inline int test_and_set_bit(unsigned long nr, volatile void *addr)
return (__atomic32_fetch_or(mask, ptr) & mask) != 0;
}
-static inline int test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_change_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -96,7 +96,7 @@ static inline void __change_bit(unsigned long nr, volatile void *addr)
*a ^= mask;
}
-static inline int __test_and_clear_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_clear_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -108,7 +108,7 @@ static inline int __test_and_clear_bit(unsigned long nr, volatile void *addr)
return retval;
}
-static inline int __test_and_set_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_set_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -120,7 +120,7 @@ static inline int __test_and_set_bit(unsigned long nr, volatile void *addr)
return retval;
}
-static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_change_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -135,13 +135,13 @@ static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
/*
* This routine doesn't need to be atomic.
*/
-static inline int
+static inline bool
__constant_test_bit(unsigned long nr, const volatile void *addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
-static inline int __test_bit(unsigned long nr, const volatile void *addr)
+static inline bool __test_bit(unsigned long nr, const volatile void *addr)
{
int * a = (int *) addr;
int mask;
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 05999ab..8f6dfc6 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -65,7 +65,7 @@ H8300_GEN_BITOP(change_bit, "bnot")
#undef H8300_GEN_BITOP
-static inline int test_bit(int nr, const unsigned long *addr)
+static inline bool test_bit(int nr, const unsigned long *addr)
{
int ret = 0;
unsigned char *b_addr;
@@ -91,7 +91,7 @@ static inline int test_bit(int nr, const unsigned long *addr)
#define __test_bit(nr, addr) test_bit(nr, addr)
#define H8300_GEN_TEST_BITOP(FNNAME, OP) \
-static inline int FNNAME(int nr, void *addr) \
+static inline bool FNNAME(int nr, void *addr) \
{ \
int retval = 0; \
char ccrsave; \
diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
index 5e4a59b..fa6b32c 100644
--- a/arch/hexagon/include/asm/bitops.h
+++ b/arch/hexagon/include/asm/bitops.h
@@ -42,7 +42,7 @@
* @nr: bit number to clear
* @addr: pointer to memory
*/
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
int oldval;
@@ -66,7 +66,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
* @nr: bit number to set
* @addr: pointer to memory
*/
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
int oldval;
@@ -92,7 +92,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
* @nr: bit number to set
* @addr: pointer to memory
*/
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
int oldval;
@@ -157,22 +157,22 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
}
/* Apparently, at least some of these are allowed to be non-atomic */
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
return test_and_clear_bit(nr, addr);
}
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
return test_and_set_bit(nr, addr);
}
-static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_change_bit(int nr, volatile unsigned long *addr)
{
return test_and_change_bit(nr, addr);
}
-static inline int __test_bit(int nr, const volatile unsigned long *addr)
+static inline bool __test_bit(int nr, const volatile unsigned long *addr)
{
int retval;
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 71e8145..38edf72 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -196,7 +196,7 @@ __change_bit (int nr, volatile void *addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_set_bit (int nr, volatile void *addr)
{
__u32 bit, old, new;
@@ -231,7 +231,7 @@ test_and_set_bit (int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static __inline__ int
+static __inline__ bool
__test_and_set_bit (int nr, volatile void *addr)
{
__u32 *p = (__u32 *) addr + (nr >> 5);
@@ -250,7 +250,7 @@ __test_and_set_bit (int nr, volatile void *addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_clear_bit (int nr, volatile void *addr)
{
__u32 mask, old, new;
@@ -276,7 +276,7 @@ test_and_clear_bit (int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static __inline__ int
+static __inline__ bool
__test_and_clear_bit(int nr, volatile void * addr)
{
__u32 *p = (__u32 *) addr + (nr >> 5);
@@ -295,7 +295,7 @@ __test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_change_bit (int nr, volatile void *addr)
{
__u32 bit, old, new;
@@ -319,7 +319,7 @@ test_and_change_bit (int nr, volatile void *addr)
*
* This operation is non-atomic and can be reordered.
*/
-static __inline__ int
+static __inline__ bool
__test_and_change_bit (int nr, void *addr)
{
__u32 old, bit = (1 << (nr & 31));
@@ -330,7 +330,7 @@ __test_and_change_bit (int nr, void *addr)
return (old & bit) != 0;
}
-static __inline__ int
+static __inline__ bool
test_bit (int nr, const volatile void *addr)
{
return 1 & (((const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index 86ba2b4..5f12ceb 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -147,7 +147,7 @@ static __inline__ void change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_set_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_set_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
@@ -182,7 +182,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_clear_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
@@ -219,7 +219,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_change_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h
index b4a9b0d..bad8c18 100644
--- a/arch/m68k/include/asm/bitops.h
+++ b/arch/m68k/include/asm/bitops.h
@@ -13,6 +13,7 @@
#endif
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
/*
@@ -148,13 +149,13 @@ static inline void bfchg_mem_change_bit(int nr, volatile unsigned long *vaddr)
#define __change_bit(nr, vaddr) change_bit(nr, vaddr)
-static inline int test_bit(int nr, const unsigned long *vaddr)
+static inline bool test_bit(int nr, const unsigned long *vaddr)
{
return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0;
}
-static inline int bset_reg_test_and_set_bit(int nr,
+static inline bool bset_reg_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -167,7 +168,7 @@ static inline int bset_reg_test_and_set_bit(int nr,
return retval;
}
-static inline int bset_mem_test_and_set_bit(int nr,
+static inline bool bset_mem_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -179,7 +180,7 @@ static inline int bset_mem_test_and_set_bit(int nr,
return retval;
}
-static inline int bfset_mem_test_and_set_bit(int nr,
+static inline bool bfset_mem_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
@@ -204,7 +205,7 @@ static inline int bfset_mem_test_and_set_bit(int nr,
#define __test_and_set_bit(nr, vaddr) test_and_set_bit(nr, vaddr)
-static inline int bclr_reg_test_and_clear_bit(int nr,
+static inline bool bclr_reg_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -217,7 +218,7 @@ static inline int bclr_reg_test_and_clear_bit(int nr,
return retval;
}
-static inline int bclr_mem_test_and_clear_bit(int nr,
+static inline bool bclr_mem_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -229,7 +230,7 @@ static inline int bclr_mem_test_and_clear_bit(int nr,
return retval;
}
-static inline int bfclr_mem_test_and_clear_bit(int nr,
+static inline bool bfclr_mem_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
@@ -254,7 +255,7 @@ static inline int bfclr_mem_test_and_clear_bit(int nr,
#define __test_and_clear_bit(nr, vaddr) test_and_clear_bit(nr, vaddr)
-static inline int bchg_reg_test_and_change_bit(int nr,
+static inline bool bchg_reg_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -267,7 +268,7 @@ static inline int bchg_reg_test_and_change_bit(int nr,
return retval;
}
-static inline int bchg_mem_test_and_change_bit(int nr,
+static inline bool bchg_mem_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -279,7 +280,7 @@ static inline int bchg_mem_test_and_change_bit(int nr,
return retval;
}
-static inline int bfchg_mem_test_and_change_bit(int nr,
+static inline bool bfchg_mem_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
diff --git a/arch/metag/include/asm/bitops.h b/arch/metag/include/asm/bitops.h
index 2671134..11df061 100644
--- a/arch/metag/include/asm/bitops.h
+++ b/arch/metag/include/asm/bitops.h
@@ -48,7 +48,7 @@ static inline void change_bit(unsigned int bit, volatile unsigned long *p)
__global_unlock1(flags);
}
-static inline int test_and_set_bit(unsigned int bit, volatile unsigned long *p)
+static inline bool test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
unsigned long old;
@@ -67,7 +67,7 @@ static inline int test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return (old & mask) != 0;
}
-static inline int test_and_clear_bit(unsigned int bit,
+static inline bool test_and_clear_bit(unsigned int bit,
volatile unsigned long *p)
{
unsigned long flags;
@@ -87,7 +87,7 @@ static inline int test_and_clear_bit(unsigned int bit,
return (old & mask) != 0;
}
-static inline int test_and_change_bit(unsigned int bit,
+static inline bool test_and_change_bit(unsigned int bit,
volatile unsigned long *p)
{
unsigned long flags;
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index fa57cef..7e53c66 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -30,13 +30,13 @@
void __mips_set_bit(unsigned long nr, volatile unsigned long *addr);
void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr);
void __mips_change_bit(unsigned long nr, volatile unsigned long *addr);
-int __mips_test_and_set_bit(unsigned long nr,
+bool __mips_test_and_set_bit(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_set_bit_lock(unsigned long nr,
+bool __mips_test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_clear_bit(unsigned long nr,
+bool __mips_test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_change_bit(unsigned long nr,
+bool __mips_test_and_change_bit(unsigned long nr,
volatile unsigned long *addr);
@@ -210,7 +210,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(unsigned long nr,
+static inline bool test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -266,7 +266,7 @@ static inline int test_and_set_bit(unsigned long nr,
* This operation is atomic and implies acquire ordering semantics
* after the memory operation.
*/
-static inline int test_and_set_bit_lock(unsigned long nr,
+static inline bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -319,7 +319,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(unsigned long nr,
+static inline bool test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -393,7 +393,7 @@ static inline int test_and_clear_bit(unsigned long nr,
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(unsigned long nr,
+static inline bool test_and_change_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
diff --git a/arch/mips/lib/bitops.c b/arch/mips/lib/bitops.c
index 3b2a1e7..8f0ba2a 100644
--- a/arch/mips/lib/bitops.c
+++ b/arch/mips/lib/bitops.c
@@ -83,14 +83,14 @@ EXPORT_SYMBOL(__mips_change_bit);
* @nr: Bit to set
* @addr: Address to count from
*/
-int __mips_test_and_set_bit(unsigned long nr,
+bool __mips_test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -109,14 +109,14 @@ EXPORT_SYMBOL(__mips_test_and_set_bit);
* @nr: Bit to set
* @addr: Address to count from
*/
-int __mips_test_and_set_bit_lock(unsigned long nr,
+bool __mips_test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -135,13 +135,13 @@ EXPORT_SYMBOL(__mips_test_and_set_bit_lock);
* @nr: Bit to clear
* @addr: Address to count from
*/
-int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
+bool __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -160,13 +160,13 @@ EXPORT_SYMBOL(__mips_test_and_clear_bit);
* @nr: Bit to change
* @addr: Address to count from
*/
-int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
+bool __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index fe6f8e2..5b00e95 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -68,7 +68,7 @@ static inline void __clear_bit(unsigned long nr, volatile void *addr)
/*
* test bit
*/
-static inline int test_bit(unsigned long nr, const volatile void *addr)
+static inline bool test_bit(unsigned long nr, const volatile void *addr)
{
return 1UL & (((const volatile unsigned int *) addr)[nr >> 5] >> (nr & 31));
}
@@ -133,9 +133,10 @@ extern void change_bit(unsigned long nr, volatile void *addr);
/*
* test and change bit
*/
-static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_change_bit(unsigned long nr, volatile void *addr)
{
- int mask, retval;
+ int mask;
+ bool retval;
unsigned int *a = (unsigned int *)addr;
a += nr >> 5;
diff --git a/arch/openrisc/include/asm/bitops.h b/arch/openrisc/include/asm/bitops.h
index 3003cda..8b503de 100644
--- a/arch/openrisc/include/asm/bitops.h
+++ b/arch/openrisc/include/asm/bitops.h
@@ -27,6 +27,7 @@
#include <linux/irqflags.h>
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
#include <asm/bitops/__ffs.h>
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 3f9406d..bac163d 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -59,17 +59,17 @@ static __inline__ void change_bit(int nr, volatile unsigned long * addr)
_atomic_spin_unlock_irqrestore(addr, flags);
}
-static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_set_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long old;
unsigned long flags;
- int set;
+ bool set;
addr += (nr >> SHIFT_PER_LONG);
_atomic_spin_lock_irqsave(addr, flags);
old = *addr;
- set = (old & mask) ? 1 : 0;
+ set = (old & mask) ? true : false;
if (!set)
*addr = old | mask;
_atomic_spin_unlock_irqrestore(addr, flags);
@@ -77,17 +77,17 @@ static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
return set;
}
-static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_clear_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long old;
unsigned long flags;
- int set;
+ bool set;
addr += (nr >> SHIFT_PER_LONG);
_atomic_spin_lock_irqsave(addr, flags);
old = *addr;
- set = (old & mask) ? 1 : 0;
+ set = (old & mask) ? true : false;
if (set)
*addr = old & ~mask;
_atomic_spin_unlock_irqrestore(addr, flags);
@@ -95,7 +95,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
return set;
}
-static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_change_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long oldbit;
@@ -107,7 +107,7 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
*addr = oldbit ^ mask;
_atomic_spin_unlock_irqrestore(addr, flags);
- return (oldbit & mask) ? 1 : 0;
+ return (oldbit & mask) ? true : false;
}
#include <asm-generic/bitops/non-atomic.h>
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 59abc62..7838138 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -100,7 +100,7 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr)
/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
* operands. */
#define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \
-static __inline__ unsigned long fn( \
+static __inline__ bool fn( \
unsigned long mask, \
volatile unsigned long *_p) \
{ \
@@ -129,26 +129,26 @@ DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
PPC_ATOMIC_EXIT_BARRIER, 0)
-static __inline__ int test_and_set_bit(unsigned long nr,
+static __inline__ bool test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_set_bit_lock(unsigned long nr,
+static __inline__ bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_set_bits_lock(BIT_MASK(nr),
addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_clear_bit(unsigned long nr,
+static __inline__ bool test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_change_bit(unsigned long nr,
+static __inline__ bool test_and_change_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 8043f10..71e6202 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -173,7 +173,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
__BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER);
}
-static inline int
+static inline bool
test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -184,7 +184,7 @@ test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -195,7 +195,7 @@ test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
return (old & ~mask) != 0;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -228,7 +228,7 @@ static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
*addr ^= 1 << (nr & 7);
}
-static inline int
+static inline bool
__test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -239,7 +239,7 @@ __test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int
+static inline bool
__test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -250,7 +250,7 @@ __test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int
+static inline bool
__test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -261,7 +261,7 @@ __test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
+static inline bool test_bit(unsigned long nr, const volatile unsigned long *ptr)
{
const volatile unsigned char *addr;
@@ -270,7 +270,7 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
return (*addr >> (nr & 7)) & 1;
}
-static inline int test_and_set_bit_lock(unsigned long nr,
+static inline bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *ptr)
{
if (test_bit(nr, ptr))
@@ -321,7 +321,7 @@ static inline void __clear_bit_inv(unsigned long nr, volatile unsigned long *ptr
return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
}
-static inline int test_bit_inv(unsigned long nr,
+static inline bool test_bit_inv(unsigned long nr,
const volatile unsigned long *ptr)
{
return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);
diff --git a/arch/sh/include/asm/bitops-cas.h b/arch/sh/include/asm/bitops-cas.h
index 88f793c..c4fde9c 100644
--- a/arch/sh/include/asm/bitops-cas.h
+++ b/arch/sh/include/asm/bitops-cas.h
@@ -46,7 +46,7 @@ static inline void change_bit(int nr, volatile void *addr)
while (__bo_cas(a, old, old^mask) != old);
}
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
@@ -60,7 +60,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
return !!(old & mask);
}
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
@@ -74,7 +74,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
return !!(old & mask);
}
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
diff --git a/arch/sh/include/asm/bitops-grb.h b/arch/sh/include/asm/bitops-grb.h
index e73af33..866f26a 100644
--- a/arch/sh/include/asm/bitops-grb.h
+++ b/arch/sh/include/asm/bitops-grb.h
@@ -71,7 +71,7 @@ static inline void change_bit(int nr, volatile void * addr)
: "memory" , "r0", "r1");
}
-static inline int test_and_set_bit(int nr, volatile void * addr)
+static inline bool test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -102,7 +102,7 @@ static inline int test_and_set_bit(int nr, volatile void * addr)
return retval;
}
-static inline int test_and_clear_bit(int nr, volatile void * addr)
+static inline bool test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval,not_mask;
volatile unsigned int *a = addr;
@@ -136,7 +136,7 @@ static inline int test_and_clear_bit(int nr, volatile void * addr)
return retval;
}
-static inline int test_and_change_bit(int nr, volatile void * addr)
+static inline bool test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
diff --git a/arch/sh/include/asm/bitops-llsc.h b/arch/sh/include/asm/bitops-llsc.h
index d8328be..7dcf5ea 100644
--- a/arch/sh/include/asm/bitops-llsc.h
+++ b/arch/sh/include/asm/bitops-llsc.h
@@ -64,7 +64,7 @@ static inline void change_bit(int nr, volatile void *addr)
);
}
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -89,7 +89,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
return retval != 0;
}
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -115,7 +115,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
return retval != 0;
}
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
diff --git a/arch/sh/include/asm/bitops-op32.h b/arch/sh/include/asm/bitops-op32.h
index f0ae7e9..f677a4e 100644
--- a/arch/sh/include/asm/bitops-op32.h
+++ b/arch/sh/include/asm/bitops-op32.h
@@ -88,7 +88,7 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -107,7 +107,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -118,7 +118,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
}
/* WARNING: non atomic and it can be reordered! */
-static inline int __test_and_change_bit(int nr,
+static inline bool __test_and_change_bit(int nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
@@ -134,7 +134,7 @@ static inline int __test_and_change_bit(int nr,
* @nr: bit number to test
* @addr: Address to start counting from
*/
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
}
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 600ed1d..afe275a 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -28,7 +28,7 @@ unsigned long ___change_bit(unsigned long *addr, unsigned long mask);
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 if bit was previously clear and != 0 otherwise.
*/
-static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
@@ -48,7 +48,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
(void) ___set_bit(ADDR, mask);
}
-static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
@@ -68,7 +68,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
(void) ___clear_bit(ADDR, mask);
}
-static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 2d52240..8cbd032 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -15,9 +15,9 @@
#include <asm/byteorder.h>
#include <asm/barrier.h>
-int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
-int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
-int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
void set_bit(unsigned long nr, volatile unsigned long *addr);
void clear_bit(unsigned long nr, volatile unsigned long *addr);
void change_bit(unsigned long nr, volatile unsigned long *addr);
diff --git a/arch/tile/include/asm/bitops_32.h b/arch/tile/include/asm/bitops_32.h
index d1406a9..9ef0ba4 100644
--- a/arch/tile/include/asm/bitops_32.h
+++ b/arch/tile/include/asm/bitops_32.h
@@ -80,7 +80,7 @@ static inline void change_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
addr += BIT_WORD(nr);
@@ -96,7 +96,7 @@ static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
addr += BIT_WORD(nr);
@@ -112,7 +112,7 @@ static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(unsigned nr,
+static inline bool test_and_change_bit(unsigned nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
diff --git a/arch/tile/include/asm/bitops_64.h b/arch/tile/include/asm/bitops_64.h
index bb1a292..d970306 100644
--- a/arch/tile/include/asm/bitops_64.h
+++ b/arch/tile/include/asm/bitops_64.h
@@ -52,9 +52,9 @@ static inline void change_bit(unsigned nr, volatile unsigned long *addr)
* barrier(), to block until the atomic op is complete.
*/
-static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned nr, volatile unsigned long *addr)
{
- int val;
+ bool val;
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
smp_mb(); /* barrier for proper semantics */
val = (__insn_fetchor((void *)(addr + nr / BITS_PER_LONG), mask)
@@ -64,9 +64,9 @@ static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
}
-static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
{
- int val;
+ bool val;
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
smp_mb(); /* barrier for proper semantics */
val = (__insn_fetchand((void *)(addr + nr / BITS_PER_LONG), ~mask)
@@ -76,7 +76,7 @@ static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
}
-static inline int test_and_change_bit(unsigned nr,
+static inline bool test_and_change_bit(unsigned nr,
volatile unsigned long *addr)
{
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index d349018..485d95d 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -154,7 +154,7 @@ static inline void change_bit(unsigned int bit, volatile unsigned long *p)
: "memory");
}
-static inline int
+static inline bool
test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
@@ -175,7 +175,7 @@ test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return tmp & mask;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
@@ -196,7 +196,7 @@ test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
return tmp & mask;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
index 4967351..eb68d8d 100644
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -124,7 +124,7 @@ static inline void change_bit(int nr, volatile unsigned long *addr)
* It may be reordered on other architectures than x86.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -148,7 +148,7 @@ static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
* It can be reorderdered on other architectures other than x86.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -171,7 +171,7 @@ static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 6173154..c610b99 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -49,7 +49,7 @@ extern unsigned long find_next_bit_le(const void *addr,
#error "Please fix <asm/byteorder.h>"
#endif
-static inline int test_bit_le(int nr, const void *addr)
+static inline bool test_bit_le(int nr, const void *addr)
{
return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
@@ -74,22 +74,22 @@ static inline void __clear_bit_le(int nr, void *addr)
__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int test_and_set_bit_le(int nr, void *addr)
+static inline bool test_and_set_bit_le(int nr, void *addr)
{
return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int test_and_clear_bit_le(int nr, void *addr)
+static inline bool test_and_clear_bit_le(int nr, void *addr)
{
return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int __test_and_set_bit_le(int nr, void *addr)
+static inline bool __test_and_set_bit_le(int nr, void *addr)
{
return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int __test_and_clear_bit_le(int nr, void *addr)
+static inline bool __test_and_clear_bit_le(int nr, void *addr)
{
return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
diff --git a/include/asm-generic/bitops/non-atomic.h b/include/asm-generic/bitops/non-atomic.h
index 697cc2b..fea2b40 100644
--- a/include/asm-generic/bitops/non-atomic.h
+++ b/include/asm-generic/bitops/non-atomic.h
@@ -54,7 +54,7 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -73,7 +73,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -84,7 +84,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
}
/* WARNING: non atomic and it can be reordered! */
-static inline int __test_and_change_bit(int nr,
+static inline bool __test_and_change_bit(int nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
@@ -100,7 +100,7 @@ static inline int __test_and_change_bit(int nr,
* @nr: bit number to test
* @addr: Address to start counting from
*/
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
}
--
1.9.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-08-28 14:55 ` chengang
0 siblings, 0 replies; 16+ messages in thread
From: chengang @ 2016-08-28 14:55 UTC (permalink / raw)
To: akpm
Cc: minchan, vbabka, gi-oh.kim, iamjoonsoo.kim, hillf.zj, mgorman,
mhocko, rientjes, linux-kernel, rth, ink, mattst88, vgupta,
linux, catalin.marinas, will.deacon, hskinnemoen, egtvedt,
realmz6, ysato, rkuo, tony.luck, fenghua.yu, geert, james.hogan,
ralf, dhowells, deller, benh, paulus, mpe, schwidefsky,
heiko.carstens, dalias, davem, cmetcalf
From: Chen Gang <gang.chen.5i5j@gmail.com>
Also use the same changing to asm-generic, and also use bool variable
instead of int variable for mips, mn10300, parisc and tile related
functions, and also avoid checkpatch.pl to report ERROR.
Include linux/types.h for alpha, arm, arm64, m68k, and openrisc to pass
building.
Originally, except powerpc and xtensa, all another architectures intend
to return 0 or 1. After this patch, also let powerpc and xtensa return 0
or 1.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
arch/alpha/include/asm/bitops.h | 17 +++++++++--------
arch/arc/include/asm/bitops.h | 10 +++++-----
arch/arm/include/asm/bitops.h | 13 +++++++------
arch/arm64/include/asm/bitops.h | 7 ++++---
arch/avr32/include/asm/bitops.h | 6 +++---
arch/blackfin/include/asm/bitops.h | 16 ++++++++--------
arch/frv/include/asm/bitops.h | 16 ++++++++--------
arch/h8300/include/asm/bitops.h | 4 ++--
arch/hexagon/include/asm/bitops.h | 14 +++++++-------
arch/ia64/include/asm/bitops.h | 14 +++++++-------
arch/m32r/include/asm/bitops.h | 6 +++---
arch/m68k/include/asm/bitops.h | 21 +++++++++++----------
arch/metag/include/asm/bitops.h | 6 +++---
arch/mips/include/asm/bitops.h | 16 ++++++++--------
arch/mips/lib/bitops.c | 16 ++++++++--------
arch/mn10300/include/asm/bitops.h | 7 ++++---
arch/openrisc/include/asm/bitops.h | 1 +
arch/parisc/include/asm/bitops.h | 16 ++++++++--------
arch/powerpc/include/asm/bitops.h | 10 +++++-----
arch/s390/include/asm/bitops.h | 18 +++++++++---------
arch/sh/include/asm/bitops-cas.h | 6 +++---
arch/sh/include/asm/bitops-grb.h | 6 +++---
arch/sh/include/asm/bitops-llsc.h | 6 +++---
arch/sh/include/asm/bitops-op32.h | 8 ++++----
arch/sparc/include/asm/bitops_32.h | 6 +++---
arch/sparc/include/asm/bitops_64.h | 6 +++---
arch/tile/include/asm/bitops_32.h | 6 +++---
arch/tile/include/asm/bitops_64.h | 10 +++++-----
arch/xtensa/include/asm/bitops.h | 6 +++---
include/asm-generic/bitops/atomic.h | 6 +++---
include/asm-generic/bitops/le.h | 10 +++++-----
include/asm-generic/bitops/non-atomic.h | 8 ++++----
32 files changed, 162 insertions(+), 156 deletions(-)
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 4bdfbd4..789b2bb 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -6,6 +6,7 @@
#endif
#include <asm/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
/*
@@ -125,7 +126,7 @@ __change_bit(unsigned long nr, volatile void * addr)
*m ^= 1 << (nr & 31);
}
-static inline int
+static inline bool
test_and_set_bit(unsigned long nr, volatile void *addr)
{
unsigned long oldbit;
@@ -155,7 +156,7 @@ test_and_set_bit(unsigned long nr, volatile void *addr)
return oldbit != 0;
}
-static inline int
+static inline bool
test_and_set_bit_lock(unsigned long nr, volatile void *addr)
{
unsigned long oldbit;
@@ -185,7 +186,7 @@ test_and_set_bit_lock(unsigned long nr, volatile void *addr)
/*
* WARNING: non atomic version.
*/
-static inline int
+static inline bool
__test_and_set_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -196,7 +197,7 @@ __test_and_set_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned long nr, volatile void * addr)
{
unsigned long oldbit;
@@ -229,7 +230,7 @@ test_and_clear_bit(unsigned long nr, volatile void * addr)
/*
* WARNING: non atomic version.
*/
-static inline int
+static inline bool
__test_and_clear_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -240,7 +241,7 @@ __test_and_clear_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned long nr, volatile void * addr)
{
unsigned long oldbit;
@@ -271,7 +272,7 @@ test_and_change_bit(unsigned long nr, volatile void * addr)
/*
* WARNING: non atomic version.
*/
-static __inline__ int
+static __inline__ bool
__test_and_change_bit(unsigned long nr, volatile void * addr)
{
unsigned long mask = 1 << (nr & 0x1f);
@@ -282,7 +283,7 @@ __test_and_change_bit(unsigned long nr, volatile void * addr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_bit(int nr, const volatile void * addr)
{
return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h
index 8da87fee..e1976ab 100644
--- a/arch/arc/include/asm/bitops.h
+++ b/arch/arc/include/asm/bitops.h
@@ -60,7 +60,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
* and the old value of bit is returned
*/
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old, temp; \
\
@@ -124,7 +124,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
}
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old, flags; \
m += nr >> 5; \
@@ -160,7 +160,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\
}
#define TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old; \
\
@@ -204,7 +204,7 @@ static inline void __##op##_bit(unsigned long nr, volatile unsigned long *m) \
}
#define __TEST_N_BIT_OP(op, c_op, asm_op) \
-static inline int __test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
+static inline bool __test_and_##op##_bit(unsigned long nr, volatile unsigned long *m)\
{ \
unsigned long old; \
m += nr >> 5; \
@@ -242,7 +242,7 @@ BIT_OPS(change, ^, CTOP_INST_AXOR_DI_R2_R2_R3)
/*
* This routine doesn't need to be atomic.
*/
-static inline int
+static inline bool
test_bit(unsigned int nr, const volatile unsigned long *addr)
{
unsigned long mask;
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index e943e6c..196bf2d 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -24,6 +24,7 @@
#endif
#include <linux/compiler.h>
+#include <linux/types.h>
#include <linux/irqflags.h>
#include <asm/barrier.h>
@@ -68,7 +69,7 @@ static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned lon
raw_local_irq_restore(flags);
}
-static inline int
+static inline bool
____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -85,7 +86,7 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return (res & mask) != 0;
}
-static inline int
+static inline bool
____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -102,7 +103,7 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
return (res & mask) != 0;
}
-static inline int
+static inline bool
____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
@@ -152,9 +153,9 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
extern void _set_bit(int nr, volatile unsigned long * p);
extern void _clear_bit(int nr, volatile unsigned long * p);
extern void _change_bit(int nr, volatile unsigned long * p);
-extern int _test_and_set_bit(int nr, volatile unsigned long * p);
-extern int _test_and_clear_bit(int nr, volatile unsigned long * p);
-extern int _test_and_change_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_set_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_clear_bit(int nr, volatile unsigned long * p);
+extern bool _test_and_change_bit(int nr, volatile unsigned long * p);
/*
* Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
diff --git a/arch/arm64/include/asm/bitops.h b/arch/arm64/include/asm/bitops.h
index 9c19594..1a94dc2 100644
--- a/arch/arm64/include/asm/bitops.h
+++ b/arch/arm64/include/asm/bitops.h
@@ -17,6 +17,7 @@
#define __ASM_BITOPS_H
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
#ifndef _LINUX_BITOPS_H
@@ -29,9 +30,9 @@
extern void set_bit(int nr, volatile unsigned long *p);
extern void clear_bit(int nr, volatile unsigned long *p);
extern void change_bit(int nr, volatile unsigned long *p);
-extern int test_and_set_bit(int nr, volatile unsigned long *p);
-extern int test_and_clear_bit(int nr, volatile unsigned long *p);
-extern int test_and_change_bit(int nr, volatile unsigned long *p);
+extern bool test_and_set_bit(int nr, volatile unsigned long *p);
+extern bool test_and_clear_bit(int nr, volatile unsigned long *p);
+extern bool test_and_change_bit(int nr, volatile unsigned long *p);
#include <asm-generic/bitops/builtin-__ffs.h>
#include <asm-generic/bitops/builtin-ffs.h>
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 910d537..0e3e08b 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -128,7 +128,7 @@ static inline void change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(int nr, volatile void * addr)
+static inline bool test_and_set_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
@@ -168,7 +168,7 @@ static inline int test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(int nr, volatile void * addr)
+static inline bool test_and_clear_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
@@ -209,7 +209,7 @@ static inline int test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(int nr, volatile void * addr)
+static inline bool test_and_change_bit(int nr, volatile void * addr)
{
unsigned long *p = ((unsigned long *)addr) + nr / BITS_PER_LONG;
unsigned long mask = 1UL << (nr % BITS_PER_LONG);
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index b298b65..ff43a11 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -47,13 +47,13 @@ asmlinkage int __raw_bit_clear_asm(volatile unsigned long *addr, int nr);
asmlinkage int __raw_bit_toggle_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_set_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_set_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_clear_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_clear_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_toggle_asm(volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_toggle_asm(volatile unsigned long *addr, int nr);
-asmlinkage int __raw_bit_test_asm(const volatile unsigned long *addr, int nr);
+asmlinkage bool __raw_bit_test_asm(const volatile unsigned long *addr, int nr);
static inline void set_bit(int nr, volatile unsigned long *addr)
{
@@ -73,25 +73,25 @@ static inline void change_bit(int nr, volatile unsigned long *addr)
__raw_bit_toggle_asm(a, nr & 0x1f);
}
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
volatile const unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_asm(a, nr & 0x1f) != 0;
}
-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_set_asm(a, nr & 0x1f);
}
-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_clear_asm(a, nr & 0x1f);
}
-static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(int nr, volatile unsigned long *addr)
{
volatile unsigned long *a = addr + (nr >> 5);
return __raw_bit_test_toggle_asm(a, nr & 0x1f);
diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h
index 0df8e95..c9bf93d 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -27,7 +27,7 @@
#include <asm/atomic.h>
-static inline int test_and_clear_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_clear_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -35,7 +35,7 @@ static inline int test_and_clear_bit(unsigned long nr, volatile void *addr)
return (__atomic32_fetch_and(~mask, ptr) & mask) != 0;
}
-static inline int test_and_set_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_set_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -43,7 +43,7 @@ static inline int test_and_set_bit(unsigned long nr, volatile void *addr)
return (__atomic32_fetch_or(mask, ptr) & mask) != 0;
}
-static inline int test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool test_and_change_bit(unsigned long nr, volatile void *addr)
{
unsigned int *ptr = (void *)addr;
unsigned int mask = 1UL << (nr & 31);
@@ -96,7 +96,7 @@ static inline void __change_bit(unsigned long nr, volatile void *addr)
*a ^= mask;
}
-static inline int __test_and_clear_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_clear_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -108,7 +108,7 @@ static inline int __test_and_clear_bit(unsigned long nr, volatile void *addr)
return retval;
}
-static inline int __test_and_set_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_set_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -120,7 +120,7 @@ static inline int __test_and_set_bit(unsigned long nr, volatile void *addr)
return retval;
}
-static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_change_bit(unsigned long nr, volatile void *addr)
{
volatile unsigned long *a = addr;
int mask, retval;
@@ -135,13 +135,13 @@ static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
/*
* This routine doesn't need to be atomic.
*/
-static inline int
+static inline bool
__constant_test_bit(unsigned long nr, const volatile void *addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
-static inline int __test_bit(unsigned long nr, const volatile void *addr)
+static inline bool __test_bit(unsigned long nr, const volatile void *addr)
{
int * a = (int *) addr;
int mask;
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index 05999ab..8f6dfc6 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -65,7 +65,7 @@ H8300_GEN_BITOP(change_bit, "bnot")
#undef H8300_GEN_BITOP
-static inline int test_bit(int nr, const unsigned long *addr)
+static inline bool test_bit(int nr, const unsigned long *addr)
{
int ret = 0;
unsigned char *b_addr;
@@ -91,7 +91,7 @@ static inline int test_bit(int nr, const unsigned long *addr)
#define __test_bit(nr, addr) test_bit(nr, addr)
#define H8300_GEN_TEST_BITOP(FNNAME, OP) \
-static inline int FNNAME(int nr, void *addr) \
+static inline bool FNNAME(int nr, void *addr) \
{ \
int retval = 0; \
char ccrsave; \
diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
index 5e4a59b..fa6b32c 100644
--- a/arch/hexagon/include/asm/bitops.h
+++ b/arch/hexagon/include/asm/bitops.h
@@ -42,7 +42,7 @@
* @nr: bit number to clear
* @addr: pointer to memory
*/
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
int oldval;
@@ -66,7 +66,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
* @nr: bit number to set
* @addr: pointer to memory
*/
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
int oldval;
@@ -92,7 +92,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
* @nr: bit number to set
* @addr: pointer to memory
*/
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
int oldval;
@@ -157,22 +157,22 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
}
/* Apparently, at least some of these are allowed to be non-atomic */
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
return test_and_clear_bit(nr, addr);
}
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
return test_and_set_bit(nr, addr);
}
-static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_change_bit(int nr, volatile unsigned long *addr)
{
return test_and_change_bit(nr, addr);
}
-static inline int __test_bit(int nr, const volatile unsigned long *addr)
+static inline bool __test_bit(int nr, const volatile unsigned long *addr)
{
int retval;
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 71e8145..38edf72 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -196,7 +196,7 @@ __change_bit (int nr, volatile void *addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_set_bit (int nr, volatile void *addr)
{
__u32 bit, old, new;
@@ -231,7 +231,7 @@ test_and_set_bit (int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static __inline__ int
+static __inline__ bool
__test_and_set_bit (int nr, volatile void *addr)
{
__u32 *p = (__u32 *) addr + (nr >> 5);
@@ -250,7 +250,7 @@ __test_and_set_bit (int nr, volatile void *addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_clear_bit (int nr, volatile void *addr)
{
__u32 mask, old, new;
@@ -276,7 +276,7 @@ test_and_clear_bit (int nr, volatile void *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static __inline__ int
+static __inline__ bool
__test_and_clear_bit(int nr, volatile void * addr)
{
__u32 *p = (__u32 *) addr + (nr >> 5);
@@ -295,7 +295,7 @@ __test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies the acquisition side of the memory barrier.
*/
-static __inline__ int
+static __inline__ bool
test_and_change_bit (int nr, volatile void *addr)
{
__u32 bit, old, new;
@@ -319,7 +319,7 @@ test_and_change_bit (int nr, volatile void *addr)
*
* This operation is non-atomic and can be reordered.
*/
-static __inline__ int
+static __inline__ bool
__test_and_change_bit (int nr, void *addr)
{
__u32 old, bit = (1 << (nr & 31));
@@ -330,7 +330,7 @@ __test_and_change_bit (int nr, void *addr)
return (old & bit) != 0;
}
-static __inline__ int
+static __inline__ bool
test_bit (int nr, const volatile void *addr)
{
return 1 & (((const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index 86ba2b4..5f12ceb 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -147,7 +147,7 @@ static __inline__ void change_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_set_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_set_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
@@ -182,7 +182,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_clear_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
@@ -219,7 +219,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ bool test_and_change_bit(int nr, volatile void * addr)
{
__u32 mask, oldbit;
volatile __u32 *a = addr;
diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h
index b4a9b0d..bad8c18 100644
--- a/arch/m68k/include/asm/bitops.h
+++ b/arch/m68k/include/asm/bitops.h
@@ -13,6 +13,7 @@
#endif
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
/*
@@ -148,13 +149,13 @@ static inline void bfchg_mem_change_bit(int nr, volatile unsigned long *vaddr)
#define __change_bit(nr, vaddr) change_bit(nr, vaddr)
-static inline int test_bit(int nr, const unsigned long *vaddr)
+static inline bool test_bit(int nr, const unsigned long *vaddr)
{
return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0;
}
-static inline int bset_reg_test_and_set_bit(int nr,
+static inline bool bset_reg_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -167,7 +168,7 @@ static inline int bset_reg_test_and_set_bit(int nr,
return retval;
}
-static inline int bset_mem_test_and_set_bit(int nr,
+static inline bool bset_mem_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -179,7 +180,7 @@ static inline int bset_mem_test_and_set_bit(int nr,
return retval;
}
-static inline int bfset_mem_test_and_set_bit(int nr,
+static inline bool bfset_mem_test_and_set_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
@@ -204,7 +205,7 @@ static inline int bfset_mem_test_and_set_bit(int nr,
#define __test_and_set_bit(nr, vaddr) test_and_set_bit(nr, vaddr)
-static inline int bclr_reg_test_and_clear_bit(int nr,
+static inline bool bclr_reg_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -217,7 +218,7 @@ static inline int bclr_reg_test_and_clear_bit(int nr,
return retval;
}
-static inline int bclr_mem_test_and_clear_bit(int nr,
+static inline bool bclr_mem_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -229,7 +230,7 @@ static inline int bclr_mem_test_and_clear_bit(int nr,
return retval;
}
-static inline int bfclr_mem_test_and_clear_bit(int nr,
+static inline bool bfclr_mem_test_and_clear_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
@@ -254,7 +255,7 @@ static inline int bfclr_mem_test_and_clear_bit(int nr,
#define __test_and_clear_bit(nr, vaddr) test_and_clear_bit(nr, vaddr)
-static inline int bchg_reg_test_and_change_bit(int nr,
+static inline bool bchg_reg_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -267,7 +268,7 @@ static inline int bchg_reg_test_and_change_bit(int nr,
return retval;
}
-static inline int bchg_mem_test_and_change_bit(int nr,
+static inline bool bchg_mem_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
@@ -279,7 +280,7 @@ static inline int bchg_mem_test_and_change_bit(int nr,
return retval;
}
-static inline int bfchg_mem_test_and_change_bit(int nr,
+static inline bool bfchg_mem_test_and_change_bit(int nr,
volatile unsigned long *vaddr)
{
char retval;
diff --git a/arch/metag/include/asm/bitops.h b/arch/metag/include/asm/bitops.h
index 2671134..11df061 100644
--- a/arch/metag/include/asm/bitops.h
+++ b/arch/metag/include/asm/bitops.h
@@ -48,7 +48,7 @@ static inline void change_bit(unsigned int bit, volatile unsigned long *p)
__global_unlock1(flags);
}
-static inline int test_and_set_bit(unsigned int bit, volatile unsigned long *p)
+static inline bool test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long flags;
unsigned long old;
@@ -67,7 +67,7 @@ static inline int test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return (old & mask) != 0;
}
-static inline int test_and_clear_bit(unsigned int bit,
+static inline bool test_and_clear_bit(unsigned int bit,
volatile unsigned long *p)
{
unsigned long flags;
@@ -87,7 +87,7 @@ static inline int test_and_clear_bit(unsigned int bit,
return (old & mask) != 0;
}
-static inline int test_and_change_bit(unsigned int bit,
+static inline bool test_and_change_bit(unsigned int bit,
volatile unsigned long *p)
{
unsigned long flags;
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index fa57cef..7e53c66 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -30,13 +30,13 @@
void __mips_set_bit(unsigned long nr, volatile unsigned long *addr);
void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr);
void __mips_change_bit(unsigned long nr, volatile unsigned long *addr);
-int __mips_test_and_set_bit(unsigned long nr,
+bool __mips_test_and_set_bit(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_set_bit_lock(unsigned long nr,
+bool __mips_test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_clear_bit(unsigned long nr,
+bool __mips_test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr);
-int __mips_test_and_change_bit(unsigned long nr,
+bool __mips_test_and_change_bit(unsigned long nr,
volatile unsigned long *addr);
@@ -210,7 +210,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(unsigned long nr,
+static inline bool test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -266,7 +266,7 @@ static inline int test_and_set_bit(unsigned long nr,
* This operation is atomic and implies acquire ordering semantics
* after the memory operation.
*/
-static inline int test_and_set_bit_lock(unsigned long nr,
+static inline bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -319,7 +319,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(unsigned long nr,
+static inline bool test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
@@ -393,7 +393,7 @@ static inline int test_and_clear_bit(unsigned long nr,
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(unsigned long nr,
+static inline bool test_and_change_bit(unsigned long nr,
volatile unsigned long *addr)
{
int bit = nr & SZLONG_MASK;
diff --git a/arch/mips/lib/bitops.c b/arch/mips/lib/bitops.c
index 3b2a1e7..8f0ba2a 100644
--- a/arch/mips/lib/bitops.c
+++ b/arch/mips/lib/bitops.c
@@ -83,14 +83,14 @@ EXPORT_SYMBOL(__mips_change_bit);
* @nr: Bit to set
* @addr: Address to count from
*/
-int __mips_test_and_set_bit(unsigned long nr,
+bool __mips_test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -109,14 +109,14 @@ EXPORT_SYMBOL(__mips_test_and_set_bit);
* @nr: Bit to set
* @addr: Address to count from
*/
-int __mips_test_and_set_bit_lock(unsigned long nr,
+bool __mips_test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -135,13 +135,13 @@ EXPORT_SYMBOL(__mips_test_and_set_bit_lock);
* @nr: Bit to clear
* @addr: Address to count from
*/
-int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
+bool __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
@@ -160,13 +160,13 @@ EXPORT_SYMBOL(__mips_test_and_clear_bit);
* @nr: Bit to change
* @addr: Address to count from
*/
-int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
+bool __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
- int res;
+ bool res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index fe6f8e2..5b00e95 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -68,7 +68,7 @@ static inline void __clear_bit(unsigned long nr, volatile void *addr)
/*
* test bit
*/
-static inline int test_bit(unsigned long nr, const volatile void *addr)
+static inline bool test_bit(unsigned long nr, const volatile void *addr)
{
return 1UL & (((const volatile unsigned int *) addr)[nr >> 5] >> (nr & 31));
}
@@ -133,9 +133,10 @@ extern void change_bit(unsigned long nr, volatile void *addr);
/*
* test and change bit
*/
-static inline int __test_and_change_bit(unsigned long nr, volatile void *addr)
+static inline bool __test_and_change_bit(unsigned long nr, volatile void *addr)
{
- int mask, retval;
+ int mask;
+ bool retval;
unsigned int *a = (unsigned int *)addr;
a += nr >> 5;
diff --git a/arch/openrisc/include/asm/bitops.h b/arch/openrisc/include/asm/bitops.h
index 3003cda..8b503de 100644
--- a/arch/openrisc/include/asm/bitops.h
+++ b/arch/openrisc/include/asm/bitops.h
@@ -27,6 +27,7 @@
#include <linux/irqflags.h>
#include <linux/compiler.h>
+#include <linux/types.h>
#include <asm/barrier.h>
#include <asm/bitops/__ffs.h>
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 3f9406d..bac163d 100644
--- a/arch/parisc/include/asm/bitops.h
+++ b/arch/parisc/include/asm/bitops.h
@@ -59,17 +59,17 @@ static __inline__ void change_bit(int nr, volatile unsigned long * addr)
_atomic_spin_unlock_irqrestore(addr, flags);
}
-static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_set_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long old;
unsigned long flags;
- int set;
+ bool set;
addr += (nr >> SHIFT_PER_LONG);
_atomic_spin_lock_irqsave(addr, flags);
old = *addr;
- set = (old & mask) ? 1 : 0;
+ set = (old & mask) ? true : false;
if (!set)
*addr = old | mask;
_atomic_spin_unlock_irqrestore(addr, flags);
@@ -77,17 +77,17 @@ static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
return set;
}
-static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_clear_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long old;
unsigned long flags;
- int set;
+ bool set;
addr += (nr >> SHIFT_PER_LONG);
_atomic_spin_lock_irqsave(addr, flags);
old = *addr;
- set = (old & mask) ? 1 : 0;
+ set = (old & mask) ? true : false;
if (set)
*addr = old & ~mask;
_atomic_spin_unlock_irqrestore(addr, flags);
@@ -95,7 +95,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
return set;
}
-static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
+static __inline__ bool test_and_change_bit(int nr, volatile unsigned long * addr)
{
unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
unsigned long oldbit;
@@ -107,7 +107,7 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
*addr = oldbit ^ mask;
_atomic_spin_unlock_irqrestore(addr, flags);
- return (oldbit & mask) ? 1 : 0;
+ return (oldbit & mask) ? true : false;
}
#include <asm-generic/bitops/non-atomic.h>
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 59abc62..7838138 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -100,7 +100,7 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr)
/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
* operands. */
#define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \
-static __inline__ unsigned long fn( \
+static __inline__ bool fn( \
unsigned long mask, \
volatile unsigned long *_p) \
{ \
@@ -129,26 +129,26 @@ DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
PPC_ATOMIC_EXIT_BARRIER, 0)
-static __inline__ int test_and_set_bit(unsigned long nr,
+static __inline__ bool test_and_set_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_set_bit_lock(unsigned long nr,
+static __inline__ bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_set_bits_lock(BIT_MASK(nr),
addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_clear_bit(unsigned long nr,
+static __inline__ bool test_and_clear_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
}
-static __inline__ int test_and_change_bit(unsigned long nr,
+static __inline__ bool test_and_change_bit(unsigned long nr,
volatile unsigned long *addr)
{
return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0;
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 8043f10..71e6202 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -173,7 +173,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
__BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER);
}
-static inline int
+static inline bool
test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -184,7 +184,7 @@ test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
return (old & mask) != 0;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -195,7 +195,7 @@ test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
return (old & ~mask) != 0;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned long *addr = __bitops_word(nr, ptr);
@@ -228,7 +228,7 @@ static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
*addr ^= 1 << (nr & 7);
}
-static inline int
+static inline bool
__test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -239,7 +239,7 @@ __test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int
+static inline bool
__test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -250,7 +250,7 @@ __test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int
+static inline bool
__test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
{
unsigned char *addr = __bitops_byte(nr, ptr);
@@ -261,7 +261,7 @@ __test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
return (ch >> (nr & 7)) & 1;
}
-static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
+static inline bool test_bit(unsigned long nr, const volatile unsigned long *ptr)
{
const volatile unsigned char *addr;
@@ -270,7 +270,7 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
return (*addr >> (nr & 7)) & 1;
}
-static inline int test_and_set_bit_lock(unsigned long nr,
+static inline bool test_and_set_bit_lock(unsigned long nr,
volatile unsigned long *ptr)
{
if (test_bit(nr, ptr))
@@ -321,7 +321,7 @@ static inline void __clear_bit_inv(unsigned long nr, volatile unsigned long *ptr
return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
}
-static inline int test_bit_inv(unsigned long nr,
+static inline bool test_bit_inv(unsigned long nr,
const volatile unsigned long *ptr)
{
return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);
diff --git a/arch/sh/include/asm/bitops-cas.h b/arch/sh/include/asm/bitops-cas.h
index 88f793c..c4fde9c 100644
--- a/arch/sh/include/asm/bitops-cas.h
+++ b/arch/sh/include/asm/bitops-cas.h
@@ -46,7 +46,7 @@ static inline void change_bit(int nr, volatile void *addr)
while (__bo_cas(a, old, old^mask) != old);
}
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
@@ -60,7 +60,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
return !!(old & mask);
}
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
@@ -74,7 +74,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
return !!(old & mask);
}
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
unsigned mask, old;
volatile unsigned *a = addr;
diff --git a/arch/sh/include/asm/bitops-grb.h b/arch/sh/include/asm/bitops-grb.h
index e73af33..866f26a 100644
--- a/arch/sh/include/asm/bitops-grb.h
+++ b/arch/sh/include/asm/bitops-grb.h
@@ -71,7 +71,7 @@ static inline void change_bit(int nr, volatile void * addr)
: "memory" , "r0", "r1");
}
-static inline int test_and_set_bit(int nr, volatile void * addr)
+static inline bool test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -102,7 +102,7 @@ static inline int test_and_set_bit(int nr, volatile void * addr)
return retval;
}
-static inline int test_and_clear_bit(int nr, volatile void * addr)
+static inline bool test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval,not_mask;
volatile unsigned int *a = addr;
@@ -136,7 +136,7 @@ static inline int test_and_clear_bit(int nr, volatile void * addr)
return retval;
}
-static inline int test_and_change_bit(int nr, volatile void * addr)
+static inline bool test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
diff --git a/arch/sh/include/asm/bitops-llsc.h b/arch/sh/include/asm/bitops-llsc.h
index d8328be..7dcf5ea 100644
--- a/arch/sh/include/asm/bitops-llsc.h
+++ b/arch/sh/include/asm/bitops-llsc.h
@@ -64,7 +64,7 @@ static inline void change_bit(int nr, volatile void *addr)
);
}
-static inline int test_and_set_bit(int nr, volatile void *addr)
+static inline bool test_and_set_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -89,7 +89,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
return retval != 0;
}
-static inline int test_and_clear_bit(int nr, volatile void *addr)
+static inline bool test_and_clear_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -115,7 +115,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
return retval != 0;
}
-static inline int test_and_change_bit(int nr, volatile void *addr)
+static inline bool test_and_change_bit(int nr, volatile void *addr)
{
int mask, retval;
volatile unsigned int *a = addr;
diff --git a/arch/sh/include/asm/bitops-op32.h b/arch/sh/include/asm/bitops-op32.h
index f0ae7e9..f677a4e 100644
--- a/arch/sh/include/asm/bitops-op32.h
+++ b/arch/sh/include/asm/bitops-op32.h
@@ -88,7 +88,7 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -107,7 +107,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -118,7 +118,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
}
/* WARNING: non atomic and it can be reordered! */
-static inline int __test_and_change_bit(int nr,
+static inline bool __test_and_change_bit(int nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
@@ -134,7 +134,7 @@ static inline int __test_and_change_bit(int nr,
* @nr: bit number to test
* @addr: Address to start counting from
*/
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
}
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 600ed1d..afe275a 100644
--- a/arch/sparc/include/asm/bitops_32.h
+++ b/arch/sparc/include/asm/bitops_32.h
@@ -28,7 +28,7 @@ unsigned long ___change_bit(unsigned long *addr, unsigned long mask);
* within the first byte. Sparc is BIG-Endian. Unless noted otherwise
* all bit-ops return 0 if bit was previously clear and != 0 otherwise.
*/
-static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
@@ -48,7 +48,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
(void) ___set_bit(ADDR, mask);
}
-static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
@@ -68,7 +68,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
(void) ___clear_bit(ADDR, mask);
}
-static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long *ADDR, mask;
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 2d52240..8cbd032 100644
--- a/arch/sparc/include/asm/bitops_64.h
+++ b/arch/sparc/include/asm/bitops_64.h
@@ -15,9 +15,9 @@
#include <asm/byteorder.h>
#include <asm/barrier.h>
-int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
-int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
-int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
+bool test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
void set_bit(unsigned long nr, volatile unsigned long *addr);
void clear_bit(unsigned long nr, volatile unsigned long *addr);
void change_bit(unsigned long nr, volatile unsigned long *addr);
diff --git a/arch/tile/include/asm/bitops_32.h b/arch/tile/include/asm/bitops_32.h
index d1406a9..9ef0ba4 100644
--- a/arch/tile/include/asm/bitops_32.h
+++ b/arch/tile/include/asm/bitops_32.h
@@ -80,7 +80,7 @@ static inline void change_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
addr += BIT_WORD(nr);
@@ -96,7 +96,7 @@ static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
addr += BIT_WORD(nr);
@@ -112,7 +112,7 @@ static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(unsigned nr,
+static inline bool test_and_change_bit(unsigned nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
diff --git a/arch/tile/include/asm/bitops_64.h b/arch/tile/include/asm/bitops_64.h
index bb1a292..d970306 100644
--- a/arch/tile/include/asm/bitops_64.h
+++ b/arch/tile/include/asm/bitops_64.h
@@ -52,9 +52,9 @@ static inline void change_bit(unsigned nr, volatile unsigned long *addr)
* barrier(), to block until the atomic op is complete.
*/
-static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(unsigned nr, volatile unsigned long *addr)
{
- int val;
+ bool val;
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
smp_mb(); /* barrier for proper semantics */
val = (__insn_fetchor((void *)(addr + nr / BITS_PER_LONG), mask)
@@ -64,9 +64,9 @@ static inline int test_and_set_bit(unsigned nr, volatile unsigned long *addr)
}
-static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
{
- int val;
+ bool val;
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
smp_mb(); /* barrier for proper semantics */
val = (__insn_fetchand((void *)(addr + nr / BITS_PER_LONG), ~mask)
@@ -76,7 +76,7 @@ static inline int test_and_clear_bit(unsigned nr, volatile unsigned long *addr)
}
-static inline int test_and_change_bit(unsigned nr,
+static inline bool test_and_change_bit(unsigned nr,
volatile unsigned long *addr)
{
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index d349018..485d95d 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -154,7 +154,7 @@ static inline void change_bit(unsigned int bit, volatile unsigned long *p)
: "memory");
}
-static inline int
+static inline bool
test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
@@ -175,7 +175,7 @@ test_and_set_bit(unsigned int bit, volatile unsigned long *p)
return tmp & mask;
}
-static inline int
+static inline bool
test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
@@ -196,7 +196,7 @@ test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
return tmp & mask;
}
-static inline int
+static inline bool
test_and_change_bit(unsigned int bit, volatile unsigned long *p)
{
unsigned long tmp, value;
diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
index 4967351..eb68d8d 100644
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -124,7 +124,7 @@ static inline void change_bit(int nr, volatile unsigned long *addr)
* It may be reordered on other architectures than x86.
* It also implies a memory barrier.
*/
-static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -148,7 +148,7 @@ static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
* It can be reorderdered on other architectures other than x86.
* It also implies a memory barrier.
*/
-static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -171,7 +171,7 @@ static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
* This operation is atomic and cannot be reordered.
* It also implies a memory barrier.
*/
-static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline bool test_and_change_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 6173154..c610b99 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -49,7 +49,7 @@ extern unsigned long find_next_bit_le(const void *addr,
#error "Please fix <asm/byteorder.h>"
#endif
-static inline int test_bit_le(int nr, const void *addr)
+static inline bool test_bit_le(int nr, const void *addr)
{
return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
@@ -74,22 +74,22 @@ static inline void __clear_bit_le(int nr, void *addr)
__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int test_and_set_bit_le(int nr, void *addr)
+static inline bool test_and_set_bit_le(int nr, void *addr)
{
return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int test_and_clear_bit_le(int nr, void *addr)
+static inline bool test_and_clear_bit_le(int nr, void *addr)
{
return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int __test_and_set_bit_le(int nr, void *addr)
+static inline bool __test_and_set_bit_le(int nr, void *addr)
{
return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
-static inline int __test_and_clear_bit_le(int nr, void *addr)
+static inline bool __test_and_clear_bit_le(int nr, void *addr)
{
return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
}
diff --git a/include/asm-generic/bitops/non-atomic.h b/include/asm-generic/bitops/non-atomic.h
index 697cc2b..fea2b40 100644
--- a/include/asm-generic/bitops/non-atomic.h
+++ b/include/asm-generic/bitops/non-atomic.h
@@ -54,7 +54,7 @@ static inline void __change_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -73,7 +73,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
* If two examples of this operation race, one can appear to succeed
* but actually fail. You must protect multiple accesses with a lock.
*/
-static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
@@ -84,7 +84,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
}
/* WARNING: non atomic and it can be reordered! */
-static inline int __test_and_change_bit(int nr,
+static inline bool __test_and_change_bit(int nr,
volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
@@ -100,7 +100,7 @@ static inline int __test_and_change_bit(int nr,
* @nr: bit number to test
* @addr: Address to start counting from
*/
-static inline int test_bit(int nr, const volatile unsigned long *addr)
+static inline bool test_bit(int nr, const volatile unsigned long *addr)
{
return 1UL & (addr[BIT_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
}
--
1.9.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-08-28 14:55 ` chengang
@ 2016-08-28 20:21 ` kbuild test robot
-1 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-08-28 20:21 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch, Chen Gang
[-- Attachment #1: Type: text/plain, Size: 23135 bytes --]
Hi Chen,
[auto build test WARNING on linus/master]
[also build test WARNING on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k
All warnings (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/isdn/hardware/mISDN/hfcsusb.c:33:
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfcusb_l2l1D':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:324:5: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L2_ACTIVATED,
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:337:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:352:4: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfc_l1callback':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:401:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:404:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_ACTIVE, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:409:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'open_dchannel':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:436:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &hw->dch.Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:437:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &hw->ech.Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'ph_state_nt':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:641:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:642:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:663:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_ACTIVE, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'rx_iso_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:1068:4: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'rx_int_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1139:4: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'tx_iso_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1368:5: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfc_bctrl':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1814:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_OPEN, &bch->Flags);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/timer.h:4,
from drivers/isdn/hisax/config.c:19:
drivers/isdn/hisax/config.c: In function 'hisax_cs_new':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/config.c:1051:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
^
drivers/isdn/hisax/config.c: In function 'hisax_b_l1l2':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/hisax.h:972:36: note: in expansion of macro 'test_and_set_bit'
#define schedule_event(s, ev) do { test_and_set_bit(ev, &s->event); schedule_work(&s->tqueue); } while (0)
^
>> drivers/isdn/hisax/config.c:1764:4: note: in expansion of macro 'schedule_event'
schedule_event(bcs, B_ACKPENDING);
^
drivers/isdn/hisax/config.c: In function 'hisax_b_l2l1':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/config.c:1844:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/m68k/include/asm/bug.h:28,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from drivers/isdn/hisax/isdnl1.c:22:
drivers/isdn/hisax/isdnl1.c: In function 'L1deactivated':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl1.c:182:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_deact_req_s':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl1.c:480:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_DEACTTIMER, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_power_up_s':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:492:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_T3RUN, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_info4_ind':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:541:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTTIMER, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer3':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:550:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_T3RUN, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer_act':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:568:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTTIMER, &st->l1.Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:569:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTIVATED, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer_deact':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:578:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_DEACTTIMER, &st->l1.Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:579:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTIVATED, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_activate_no':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:598:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTIVATING, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'dch_l2l1':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:818:4: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTIVATING, &st->l1.Flags);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/m68k/include/asm/bug.h:28,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from drivers/isdn/hisax/isdnl2.c:19:
drivers/isdn/hisax/isdnl2.c: In function 'set_peer_busy':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl2.c:111:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_PEER_BUSY, &l2->flag);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:114:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L2BLOCK, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'clear_peer_busy':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl2.c:120:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2BLOCK, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'clear_exception':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:177:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACK_PEND, &l2->flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:178:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_REJEXC, &l2->flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:179:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_OWN_BUSY, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'start_t200':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:460:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_T200_RUN, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'restart_t200':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:467:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_T200_RUN, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'establishlink':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:510:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_mdl_error_dm':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:538:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_st8_mdl_error_dm':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:554:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_establish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:638:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_discard_i_setl3':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:647:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:648:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_l3_reestablish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:658:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_pend_rel':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:674:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_reestablish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:844:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'enquiry_response':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
..
vim +/test_and_set_bit +324 drivers/isdn/hardware/mISDN/hfcsusb.c
69f52adb Karsten Keil 2009-01-09 318 _queue_data(&dch->dev.D,
69f52adb Karsten Keil 2009-01-09 319 PH_ACTIVATE_IND, MISDN_ID_ANY, 0,
69f52adb Karsten Keil 2009-01-09 320 NULL, GFP_ATOMIC);
69f52adb Karsten Keil 2009-01-09 321 } else {
69f52adb Karsten Keil 2009-01-09 322 hfcsusb_ph_command(hw,
69f52adb Karsten Keil 2009-01-09 323 HFC_L1_ACTIVATE_NT);
69f52adb Karsten Keil 2009-01-09 @324 test_and_set_bit(FLG_L2_ACTIVATED,
69f52adb Karsten Keil 2009-01-09 325 &dch->Flags);
69f52adb Karsten Keil 2009-01-09 326 }
69f52adb Karsten Keil 2009-01-09 327 } else {
69f52adb Karsten Keil 2009-01-09 328 hfcsusb_ph_command(hw, HFC_L1_ACTIVATE_TE);
69f52adb Karsten Keil 2009-01-09 329 ret = l1_event(dch->l1, hh->prim);
69f52adb Karsten Keil 2009-01-09 330 }
69f52adb Karsten Keil 2009-01-09 331 break;
69f52adb Karsten Keil 2009-01-09 332
69f52adb Karsten Keil 2009-01-09 333 case PH_DEACTIVATE_REQ:
69f52adb Karsten Keil 2009-01-09 334 if (debug & DBG_HFC_CALL_TRACE)
69f52adb Karsten Keil 2009-01-09 335 printk(KERN_DEBUG "%s: %s: PH_DEACTIVATE_REQ\n",
69f52adb Karsten Keil 2009-01-09 336 hw->name, __func__);
69f52adb Karsten Keil 2009-01-09 @337 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
69f52adb Karsten Keil 2009-01-09 338
69f52adb Karsten Keil 2009-01-09 339 if (hw->protocol == ISDN_P_NT_S0) {
69f52adb Karsten Keil 2009-01-09 340 hfcsusb_ph_command(hw, HFC_L1_DEACTIVATE_NT);
:::::: The code at line 324 was first introduced by commit
:::::: 69f52adb2d534afc41fcc658f155e01f0b322f9e mISDN: Add HFC USB driver
:::::: TO: Karsten Keil <kkeil@suse.de>
:::::: CC: Karsten Keil <kkeil@suse.de>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 37476 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-08-28 20:21 ` kbuild test robot
0 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-08-28 20:21 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
[-- Attachment #1: Type: text/plain, Size: 23135 bytes --]
Hi Chen,
[auto build test WARNING on linus/master]
[also build test WARNING on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k
All warnings (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/isdn/hardware/mISDN/hfcsusb.c:33:
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfcusb_l2l1D':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:324:5: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L2_ACTIVATED,
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:337:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:352:4: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfc_l1callback':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:401:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_TX_BUSY, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:404:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_ACTIVE, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:409:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'open_dchannel':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:436:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &hw->dch.Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:437:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &hw->ech.Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'ph_state_nt':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:641:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACTIVE, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:642:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:663:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_ACTIVE, &dch->Flags);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'rx_iso_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
>> drivers/isdn/hardware/mISDN/hfcsusb.c:1068:4: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'rx_int_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1139:4: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'tx_iso_complete':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> include/linux/mISDNhw.h:83:6: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(ev, &((s)->Flags)); \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1368:5: note: in expansion of macro 'schedule_event'
schedule_event(&hw->dch, FLG_PHCHANGE);
^
drivers/isdn/hardware/mISDN/hfcsusb.c: In function 'hfc_bctrl':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hardware/mISDN/hfcsusb.c:1814:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_OPEN, &bch->Flags);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/linux/list.h:8,
from include/linux/timer.h:4,
from drivers/isdn/hisax/config.c:19:
drivers/isdn/hisax/config.c: In function 'hisax_cs_new':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/config.c:1051:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
^
drivers/isdn/hisax/config.c: In function 'hisax_b_l1l2':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/hisax.h:972:36: note: in expansion of macro 'test_and_set_bit'
#define schedule_event(s, ev) do { test_and_set_bit(ev, &s->event); schedule_work(&s->tqueue); } while (0)
^
>> drivers/isdn/hisax/config.c:1764:4: note: in expansion of macro 'schedule_event'
schedule_event(bcs, B_ACKPENDING);
^
drivers/isdn/hisax/config.c: In function 'hisax_b_l2l1':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/config.c:1844:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/m68k/include/asm/bug.h:28,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from drivers/isdn/hisax/isdnl1.c:22:
drivers/isdn/hisax/isdnl1.c: In function 'L1deactivated':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl1.c:182:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_deact_req_s':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl1.c:480:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_DEACTTIMER, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_power_up_s':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:492:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_T3RUN, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_info4_ind':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:541:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTTIMER, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer3':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:550:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_T3RUN, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer_act':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:568:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTTIMER, &st->l1.Flags);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:569:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTIVATED, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_timer_deact':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:578:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_DEACTTIMER, &st->l1.Flags);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:579:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTIVATED, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'l1_activate_no':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:598:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L1_ACTIVATING, &st->l1.Flags);
^
drivers/isdn/hisax/isdnl1.c: In function 'dch_l2l1':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl1.c:818:4: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L1_ACTIVATING, &st->l1.Flags);
^
--
In file included from include/linux/bitops.h:36:0,
from include/linux/kernel.h:10,
from include/asm-generic/bug.h:13,
from arch/m68k/include/asm/bug.h:28,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from drivers/isdn/hisax/isdnl2.c:19:
drivers/isdn/hisax/isdnl2.c: In function 'set_peer_busy':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl2.c:111:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_PEER_BUSY, &l2->flag);
^
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:114:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L2BLOCK, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'clear_peer_busy':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
>> drivers/isdn/hisax/isdnl2.c:120:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L2BLOCK, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'clear_exception':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:177:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_ACK_PEND, &l2->flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:178:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_REJEXC, &l2->flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:179:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_OWN_BUSY, &l2->flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'start_t200':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:460:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_T200_RUN, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'restart_t200':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:467:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_T200_RUN, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'establishlink':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:510:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_mdl_error_dm':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:538:3: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_st8_mdl_error_dm':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:554:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_establish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:638:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_discard_i_setl3':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:647:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:648:2: note: in expansion of macro 'test_and_clear_bit'
test_and_clear_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_l3_reestablish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:658:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_pend_rel':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:674:2: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_PEND_REL, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'l2_reestablish':
arch/m68k/include/asm/bitops.h:201:43: warning: value computed is not used [-Wunused-value]
bset_mem_test_and_set_bit(nr, vaddr) : \
^
drivers/isdn/hisax/isdnl2.c:844:3: note: in expansion of macro 'test_and_set_bit'
test_and_set_bit(FLG_L3_INIT, &st->l2.flag);
^
drivers/isdn/hisax/isdnl2.c: In function 'enquiry_response':
arch/m68k/include/asm/bitops.h:251:45: warning: value computed is not used [-Wunused-value]
bclr_mem_test_and_clear_bit(nr, vaddr) : \
..
vim +/test_and_set_bit +324 drivers/isdn/hardware/mISDN/hfcsusb.c
69f52adb Karsten Keil 2009-01-09 318 _queue_data(&dch->dev.D,
69f52adb Karsten Keil 2009-01-09 319 PH_ACTIVATE_IND, MISDN_ID_ANY, 0,
69f52adb Karsten Keil 2009-01-09 320 NULL, GFP_ATOMIC);
69f52adb Karsten Keil 2009-01-09 321 } else {
69f52adb Karsten Keil 2009-01-09 322 hfcsusb_ph_command(hw,
69f52adb Karsten Keil 2009-01-09 323 HFC_L1_ACTIVATE_NT);
69f52adb Karsten Keil 2009-01-09 @324 test_and_set_bit(FLG_L2_ACTIVATED,
69f52adb Karsten Keil 2009-01-09 325 &dch->Flags);
69f52adb Karsten Keil 2009-01-09 326 }
69f52adb Karsten Keil 2009-01-09 327 } else {
69f52adb Karsten Keil 2009-01-09 328 hfcsusb_ph_command(hw, HFC_L1_ACTIVATE_TE);
69f52adb Karsten Keil 2009-01-09 329 ret = l1_event(dch->l1, hh->prim);
69f52adb Karsten Keil 2009-01-09 330 }
69f52adb Karsten Keil 2009-01-09 331 break;
69f52adb Karsten Keil 2009-01-09 332
69f52adb Karsten Keil 2009-01-09 333 case PH_DEACTIVATE_REQ:
69f52adb Karsten Keil 2009-01-09 334 if (debug & DBG_HFC_CALL_TRACE)
69f52adb Karsten Keil 2009-01-09 335 printk(KERN_DEBUG "%s: %s: PH_DEACTIVATE_REQ\n",
69f52adb Karsten Keil 2009-01-09 336 hw->name, __func__);
69f52adb Karsten Keil 2009-01-09 @337 test_and_clear_bit(FLG_L2_ACTIVATED, &dch->Flags);
69f52adb Karsten Keil 2009-01-09 338
69f52adb Karsten Keil 2009-01-09 339 if (hw->protocol == ISDN_P_NT_S0) {
69f52adb Karsten Keil 2009-01-09 340 hfcsusb_ph_command(hw, HFC_L1_DEACTIVATE_NT);
:::::: The code at line 324 was first introduced by commit
:::::: 69f52adb2d534afc41fcc658f155e01f0b322f9e mISDN: Add HFC USB driver
:::::: TO: Karsten Keil <kkeil@suse.de>
:::::: CC: Karsten Keil <kkeil@suse.de>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 37476 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-08-28 14:55 ` chengang
@ 2016-09-04 0:07 ` kbuild test robot
-1 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-09-04 0:07 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch, Chen Gang
[-- Attachment #1: Type: text/plain, Size: 4523 bytes --]
Hi Chen,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: powerpc-makalu_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from include/linux/radix-tree.h:24,
from kernel/memremap.c:13:
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:123:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_set_bits, or, PPC_ATOMIC_ENTRY_BARRIER,
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:125:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_set_bits_lock, or, "",
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:127:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:129:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
^
arch/powerpc/include/asm/bitops.h:132:19: error: unknown type name 'bool'
static __inline__ bool test_and_set_bit(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:138:19: error: unknown type name 'bool'
static __inline__ bool test_and_set_bit_lock(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:145:19: error: unknown type name 'bool'
static __inline__ bool test_and_clear_bit(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:151:19: error: unknown type name 'bool'
static __inline__ bool test_and_change_bit(unsigned long nr,
^
In file included from arch/powerpc/include/asm/bitops.h:157:0,
from include/linux/bitops.h:36,
from include/linux/radix-tree.h:24,
from kernel/memremap.c:13:
>> include/asm-generic/bitops/non-atomic.h:57:15: error: unknown type name 'bool'
static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
^
include/asm-generic/bitops/non-atomic.h:76:15: error: unknown type name 'bool'
static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
^
include/asm-generic/bitops/non-atomic.h:87:15: error: unknown type name 'bool'
static inline bool __test_and_change_bit(int nr,
^
include/asm-generic/bitops/non-atomic.h:103:15: error: unknown type name 'bool'
static inline bool test_bit(int nr, const volatile unsigned long *addr)
^
vim +/bool +103 arch/powerpc/include/asm/bitops.h
97 change_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
98 }
99
100 /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
101 * operands. */
102 #define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \
> 103 static __inline__ bool fn( \
104 unsigned long mask, \
105 volatile unsigned long *_p) \
106 { \
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 11123 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-04 0:07 ` kbuild test robot
0 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-09-04 0:07 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
[-- Attachment #1: Type: text/plain, Size: 4523 bytes --]
Hi Chen,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: powerpc-makalu_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from include/linux/radix-tree.h:24,
from kernel/memremap.c:13:
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:123:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_set_bits, or, PPC_ATOMIC_ENTRY_BARRIER,
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:125:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_set_bits_lock, or, "",
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:127:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
^
>> arch/powerpc/include/asm/bitops.h:103:19: error: unknown type name 'bool'
static __inline__ bool fn( \
^
arch/powerpc/include/asm/bitops.h:129:1: note: in expansion of macro 'DEFINE_TESTOP'
DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
^
arch/powerpc/include/asm/bitops.h:132:19: error: unknown type name 'bool'
static __inline__ bool test_and_set_bit(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:138:19: error: unknown type name 'bool'
static __inline__ bool test_and_set_bit_lock(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:145:19: error: unknown type name 'bool'
static __inline__ bool test_and_clear_bit(unsigned long nr,
^
arch/powerpc/include/asm/bitops.h:151:19: error: unknown type name 'bool'
static __inline__ bool test_and_change_bit(unsigned long nr,
^
In file included from arch/powerpc/include/asm/bitops.h:157:0,
from include/linux/bitops.h:36,
from include/linux/radix-tree.h:24,
from kernel/memremap.c:13:
>> include/asm-generic/bitops/non-atomic.h:57:15: error: unknown type name 'bool'
static inline bool __test_and_set_bit(int nr, volatile unsigned long *addr)
^
include/asm-generic/bitops/non-atomic.h:76:15: error: unknown type name 'bool'
static inline bool __test_and_clear_bit(int nr, volatile unsigned long *addr)
^
include/asm-generic/bitops/non-atomic.h:87:15: error: unknown type name 'bool'
static inline bool __test_and_change_bit(int nr,
^
include/asm-generic/bitops/non-atomic.h:103:15: error: unknown type name 'bool'
static inline bool test_bit(int nr, const volatile unsigned long *addr)
^
vim +/bool +103 arch/powerpc/include/asm/bitops.h
97 change_bits(BIT_MASK(nr), addr + BIT_WORD(nr));
98 }
99
100 /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
101 * operands. */
102 #define DEFINE_TESTOP(fn, op, prefix, postfix, eh) \
> 103 static __inline__ bool fn( \
104 unsigned long mask, \
105 volatile unsigned long *_p) \
106 { \
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 11123 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-08-28 14:55 ` chengang
@ 2016-09-04 0:27 ` kbuild test robot
-1 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-09-04 0:27 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch, Chen Gang
[-- Attachment #1: Type: text/plain, Size: 2831 bytes --]
Hi Chen,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: s390-default_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=s390
All errors (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from fs/btrfs/extent_io.c:1:
>> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:198:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:231:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:242:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:253:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:264:15: error: unknown type name 'bool'
static inline bool test_bit(unsigned long nr, const volatile unsigned long *ptr)
^
arch/s390/include/asm/bitops.h:273:15: error: unknown type name 'bool'
static inline bool test_and_set_bit_lock(unsigned long nr,
^
arch/s390/include/asm/bitops.h:324:15: error: unknown type name 'bool'
static inline bool test_bit_inv(unsigned long nr,
^
vim +/bool +176 arch/s390/include/asm/bitops.h
170 }
171 #endif
172 mask = 1UL << (nr & (BITS_PER_LONG - 1));
173 __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER);
174 }
175
> 176 static inline bool
177 test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
178 {
179 unsigned long *addr = __bitops_word(nr, ptr);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 16248 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-04 0:27 ` kbuild test robot
0 siblings, 0 replies; 16+ messages in thread
From: kbuild test robot @ 2016-09-04 0:27 UTC (permalink / raw)
To: chengang
Cc: kbuild-all, akpm, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
[-- Attachment #1: Type: text/plain, Size: 2831 bytes --]
Hi Chen,
[auto build test ERROR on linus/master]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
config: s390-default_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=s390
All errors (new ones prefixed by >>):
In file included from include/linux/bitops.h:36:0,
from fs/btrfs/extent_io.c:1:
>> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:198:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:231:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:242:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:253:15: error: unknown type name 'bool'
static inline bool
^
arch/s390/include/asm/bitops.h:264:15: error: unknown type name 'bool'
static inline bool test_bit(unsigned long nr, const volatile unsigned long *ptr)
^
arch/s390/include/asm/bitops.h:273:15: error: unknown type name 'bool'
static inline bool test_and_set_bit_lock(unsigned long nr,
^
arch/s390/include/asm/bitops.h:324:15: error: unknown type name 'bool'
static inline bool test_bit_inv(unsigned long nr,
^
vim +/bool +176 arch/s390/include/asm/bitops.h
170 }
171 #endif
172 mask = 1UL << (nr & (BITS_PER_LONG - 1));
173 __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER);
174 }
175
> 176 static inline bool
177 test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
178 {
179 unsigned long *addr = __bitops_word(nr, ptr);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 16248 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-09-04 0:27 ` kbuild test robot
@ 2016-09-06 19:27 ` Andrew Morton
-1 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2016-09-06 19:27 UTC (permalink / raw)
To: kbuild test robot
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch, Chen Gang
On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.8-rc4 next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
>
> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
> config: s390-default_defconfig (attached as .config)
> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=s390
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/bitops.h:36:0,
> from fs/btrfs/extent_io.c:1:
> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
> static inline bool
> ^
> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
> static inline bool
My s390 cross compiler doesn't like that config. Can someone test this?
--- a/arch/s390/include/asm/bitops.h~a
+++ a/arch/s390/include/asm/bitops.h
@@ -40,6 +40,7 @@
#error only <linux/bitops.h> can be included directly
#endif
+#include <linux/types.h>
#include <linux/typecheck.h>
#include <linux/compiler.h>
#include <asm/barrier.h>
_
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-06 19:27 ` Andrew Morton
0 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2016-09-06 19:27 UTC (permalink / raw)
To: kbuild test robot
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.8-rc4 next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
>
> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
> config: s390-default_defconfig (attached as .config)
> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
> reproduce:
> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=s390
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/bitops.h:36:0,
> from fs/btrfs/extent_io.c:1:
> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
> static inline bool
> ^
> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
> static inline bool
My s390 cross compiler doesn't like that config. Can someone test this?
--- a/arch/s390/include/asm/bitops.h~a
+++ a/arch/s390/include/asm/bitops.h
@@ -40,6 +40,7 @@
#error only <linux/bitops.h> can be included directly
#endif
+#include <linux/types.h>
#include <linux/typecheck.h>
#include <linux/compiler.h>
#include <asm/barrier.h>
_
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-09-06 19:27 ` Andrew Morton
@ 2016-09-07 1:52 ` Fengguang Wu
-1 siblings, 0 replies; 16+ messages in thread
From: Fengguang Wu @ 2016-09-07 1:52 UTC (permalink / raw)
To: Andrew Morton
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch, Chen Gang
Hi Andrew,
On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.8-rc4 next-20160825]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>
>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>> config: s390-default_defconfig (attached as .config)
>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>> reproduce:
>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # save the attached .config to linux build tree
>> make.cross ARCH=s390
>>
>> All errors (new ones prefixed by >>):
>>
>> In file included from include/linux/bitops.h:36:0,
>> from fs/btrfs/extent_io.c:1:
>> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>> static inline bool
>> ^
>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>> static inline bool
>
>My s390 cross compiler doesn't like that config. Can someone test this?
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>--- a/arch/s390/include/asm/bitops.h~a
>+++ a/arch/s390/include/asm/bitops.h
>@@ -40,6 +40,7 @@
> #error only <linux/bitops.h> can be included directly
> #endif
>
>+#include <linux/types.h>
> #include <linux/typecheck.h>
> #include <linux/compiler.h>
> #include <asm/barrier.h>
Regards,
Fengguang
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-07 1:52 ` Fengguang Wu
0 siblings, 0 replies; 16+ messages in thread
From: Fengguang Wu @ 2016-09-07 1:52 UTC (permalink / raw)
To: Andrew Morton
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
Hi Andrew,
On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.8-rc4 next-20160825]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>
>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>> config: s390-default_defconfig (attached as .config)
>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>> reproduce:
>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # save the attached .config to linux build tree
>> make.cross ARCH=s390
>>
>> All errors (new ones prefixed by >>):
>>
>> In file included from include/linux/bitops.h:36:0,
>> from fs/btrfs/extent_io.c:1:
>> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>> static inline bool
>> ^
>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>> static inline bool
>
>My s390 cross compiler doesn't like that config. Can someone test this?
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>--- a/arch/s390/include/asm/bitops.h~a
>+++ a/arch/s390/include/asm/bitops.h
>@@ -40,6 +40,7 @@
> #error only <linux/bitops.h> can be included directly
> #endif
>
>+#include <linux/types.h>
> #include <linux/typecheck.h>
> #include <linux/compiler.h>
> #include <asm/barrier.h>
Regards,
Fengguang
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-09-07 1:52 ` Fengguang Wu
@ 2016-09-07 15:39 ` Chen Gang
-1 siblings, 0 replies; 16+ messages in thread
From: Chen Gang @ 2016-09-07 15:39 UTC (permalink / raw)
To: Fengguang Wu, Andrew Morton
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias, davem,
cmetcalf, chris, jcmvbkbc, arnd, noamc, brueckner, mingo, peterz,
linux-arch
Thank you all for your work. Commonly, I should send patch v3 for it.
And very sorry for replying too late. During these days I have no
enough time on it (working, buying house, and catching a cold, but I am
lucky enough that my father's health is OK).
Thanks.
On 9/7/16 09:52, Fengguang Wu wrote:
> Hi Andrew,
>
> On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>> On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>>
>>> [auto build test ERROR on linus/master]
>>> [also build test ERROR on v4.8-rc4 next-20160825]
>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>>
>>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>>> config: s390-default_defconfig (attached as .config)
>>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>>> reproduce:
>>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>>> chmod +x ~/bin/make.cross
>>> # save the attached .config to linux build tree
>>> make.cross ARCH=s390
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> In file included from include/linux/bitops.h:36:0,
>>> from fs/btrfs/extent_io.c:1:
>>> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>>> static inline bool
>>> ^
>>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>>> static inline bool
>>
>> My s390 cross compiler doesn't like that config. Can someone test this?
>
> Tested-by: Fengguang Wu <fengguang.wu@intel.com>
>
> It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
>
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>
>> --- a/arch/s390/include/asm/bitops.h~a
>> +++ a/arch/s390/include/asm/bitops.h
>> @@ -40,6 +40,7 @@
>> #error only <linux/bitops.h> can be included directly
>> #endif
>>
>> +#include <linux/types.h>
>> #include <linux/typecheck.h>
>> #include <linux/compiler.h>
>> #include <asm/barrier.h>
>
> Regards,
> Fengguang
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-07 15:39 ` Chen Gang
0 siblings, 0 replies; 16+ messages in thread
From: Chen Gang @ 2016-09-07 15:39 UTC (permalink / raw)
To: Fengguang Wu, Andrew Morton
Cc: chengang, kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim,
hillf.zj, mgorman, mhocko, rientjes, linux-kernel, rth, ink,
mattst88, vgupta, linux, catalin.marinas, will.deacon,
hskinnemoen, egtvedt, realmz6, ysato, rkuo, tony.luck,
fenghua.yu, geert, james.hogan, ralf, dhowells, deller, benh,
paulus, mpe, schwidefsky, heiko.carstens, dalias
Thank you all for your work. Commonly, I should send patch v3 for it.
And very sorry for replying too late. During these days I have no
enough time on it (working, buying house, and catching a cold, but I am
lucky enough that my father's health is OK).
Thanks.
On 9/7/16 09:52, Fengguang Wu wrote:
> Hi Andrew,
>
> On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>> On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>>
>>> [auto build test ERROR on linus/master]
>>> [also build test ERROR on v4.8-rc4 next-20160825]
>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>>
>>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>>> config: s390-default_defconfig (attached as .config)
>>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>>> reproduce:
>>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>>> chmod +x ~/bin/make.cross
>>> # save the attached .config to linux build tree
>>> make.cross ARCH=s390
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> In file included from include/linux/bitops.h:36:0,
>>> from fs/btrfs/extent_io.c:1:
>>> >> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>>> static inline bool
>>> ^
>>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>>> static inline bool
>>
>> My s390 cross compiler doesn't like that config. Can someone test this?
>
> Tested-by: Fengguang Wu <fengguang.wu@intel.com>
>
> It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
>
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>
>> --- a/arch/s390/include/asm/bitops.h~a
>> +++ a/arch/s390/include/asm/bitops.h
>> @@ -40,6 +40,7 @@
>> #error only <linux/bitops.h> can be included directly
>> #endif
>>
>> +#include <linux/types.h>
>> #include <linux/typecheck.h>
>> #include <linux/compiler.h>
>> #include <asm/barrier.h>
>
> Regards,
> Fengguang
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
2016-09-07 15:39 ` Chen Gang
@ 2016-09-17 6:33 ` Chen Gang
-1 siblings, 0 replies; 16+ messages in thread
From: Chen Gang @ 2016-09-17 6:33 UTC (permalink / raw)
To: Fengguang Wu, Andrew Morton
Cc: kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim, hillf.zj,
mgorman, mhocko, rientjes, linux-kernel, rth, ink, mattst88,
vgupta, linux, catalin.marinas, will.deacon, hskinnemoen,
egtvedt, realmz6, ysato, rkuo, tony.luck, fenghua.yu, geert,
james.hogan, ralf, dhowells, deller, benh, paulus, mpe,
schwidefsky, heiko.carstens, dalias, davem, cmetcalf, chris,
jcmvbkbc, arnd, noamc, brueckner, mingo, peterz, linux-arch
If necessary to send patch v3 for it, please let me know (I guess not).
Next, I shall try to find and make another patches for our kernel.
Thanks.
On 9/7/16 23:39, Chen Gang wrote:
>
> Thank you all for your work. Commonly, I should send patch v3 for it.
>
> And very sorry for replying too late. During these days I have no
> enough time on it (working, buying house, and catching a cold, but I am
> lucky enough that my father's health is OK).
>
> Thanks.
>
> On 9/7/16 09:52, Fengguang Wu wrote:
>> Hi Andrew,
>>
>> On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>>> On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>>>
>>>> [auto build test ERROR on linus/master]
>>>> [also build test ERROR on v4.8-rc4 next-20160825]
>>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>>>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>>>
>>>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>>>> config: s390-default_defconfig (attached as .config)
>>>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>>>> reproduce:
>>>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>>>> chmod +x ~/bin/make.cross
>>>> # save the attached .config to linux build tree
>>>> make.cross ARCH=s390
>>>>
>>>> All errors (new ones prefixed by >>):
>>>>
>>>> In file included from include/linux/bitops.h:36:0,
>>>> from fs/btrfs/extent_io.c:1:
>>>>>> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>>>> static inline bool
>>>> ^
>>>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>>>> static inline bool
>>>
>>> My s390 cross compiler doesn't like that config. Can someone test this?
>>
>> Tested-by: Fengguang Wu <fengguang.wu@intel.com>
>>
>> It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
>>
>> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>>
>>> --- a/arch/s390/include/asm/bitops.h~a
>>> +++ a/arch/s390/include/asm/bitops.h
>>> @@ -40,6 +40,7 @@
>>> #error only <linux/bitops.h> can be included directly
>>> #endif
>>>
>>> +#include <linux/types.h>
>>> #include <linux/typecheck.h>
>>> #include <linux/compiler.h>
>>> #include <asm/barrier.h>
>>
>> Regards,
>> Fengguang
>
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
@ 2016-09-17 6:33 ` Chen Gang
0 siblings, 0 replies; 16+ messages in thread
From: Chen Gang @ 2016-09-17 6:33 UTC (permalink / raw)
To: Fengguang Wu, Andrew Morton
Cc: kbuild-all, minchan, vbabka, gi-oh.kim, iamjoonsoo.kim, hillf.zj,
mgorman, mhocko, rientjes, linux-kernel, rth, ink, mattst88,
vgupta, linux, catalin.marinas, will.deacon, hskinnemoen,
egtvedt, realmz6, ysato, rkuo, tony.luck, fenghua.yu, geert,
james.hogan, ralf, dhowells, deller, benh, paulus, mpe,
schwidefsky, heiko.carstens, dalias, davem
If necessary to send patch v3 for it, please let me know (I guess not).
Next, I shall try to find and make another patches for our kernel.
Thanks.
On 9/7/16 23:39, Chen Gang wrote:
>
> Thank you all for your work. Commonly, I should send patch v3 for it.
>
> And very sorry for replying too late. During these days I have no
> enough time on it (working, buying house, and catching a cold, but I am
> lucky enough that my father's health is OK).
>
> Thanks.
>
> On 9/7/16 09:52, Fengguang Wu wrote:
>> Hi Andrew,
>>
>> On Tue, Sep 06, 2016 at 12:27:32PM -0700, Andrew Morton wrote:
>>> On Sun, 4 Sep 2016 08:27:36 +0800 kbuild test robot <lkp@intel.com> wrote:
>>>
>>>> [auto build test ERROR on linus/master]
>>>> [also build test ERROR on v4.8-rc4 next-20160825]
>>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>>> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
>>>> [Check https://git-scm.com/docs/git-format-patch for more information]
>>>>
>>>> url: https://github.com/0day-ci/linux/commits/chengang-emindsoft-com-cn/arch-all-include-asm-bitops-Use-bool-instead-of-int-for-all-bit-test-functions/20160828-230301
>>>> config: s390-default_defconfig (attached as .config)
>>>> compiler: s390x-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
>>>> reproduce:
>>>> wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>>>> chmod +x ~/bin/make.cross
>>>> # save the attached .config to linux build tree
>>>> make.cross ARCH=s390
>>>>
>>>> All errors (new ones prefixed by >>):
>>>>
>>>> In file included from include/linux/bitops.h:36:0,
>>>> from fs/btrfs/extent_io.c:1:
>>>>>> arch/s390/include/asm/bitops.h:176:15: error: unknown type name 'bool'
>>>> static inline bool
>>>> ^
>>>> arch/s390/include/asm/bitops.h:187:15: error: unknown type name 'bool'
>>>> static inline bool
>>>
>>> My s390 cross compiler doesn't like that config. Can someone test this?
>>
>> Tested-by: Fengguang Wu <fengguang.wu@intel.com>
>>
>> It works fine with Debian's gcc-6-s390x-linux-gnu and crosstool gcc:
>>
>> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_s390x-linux.tar.xz
>>
>>> --- a/arch/s390/include/asm/bitops.h~a
>>> +++ a/arch/s390/include/asm/bitops.h
>>> @@ -40,6 +40,7 @@
>>> #error only <linux/bitops.h> can be included directly
>>> #endif
>>>
>>> +#include <linux/types.h>
>>> #include <linux/typecheck.h>
>>> #include <linux/compiler.h>
>>> #include <asm/barrier.h>
>>
>> Regards,
>> Fengguang
>
--
Chen Gang (陈刚)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-09-17 6:32 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-28 14:55 [PATCH v2] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions chengang
2016-08-28 14:55 ` chengang
2016-08-28 20:21 ` kbuild test robot
2016-08-28 20:21 ` kbuild test robot
2016-09-04 0:07 ` kbuild test robot
2016-09-04 0:07 ` kbuild test robot
2016-09-04 0:27 ` kbuild test robot
2016-09-04 0:27 ` kbuild test robot
2016-09-06 19:27 ` Andrew Morton
2016-09-06 19:27 ` Andrew Morton
2016-09-07 1:52 ` Fengguang Wu
2016-09-07 1:52 ` Fengguang Wu
2016-09-07 15:39 ` Chen Gang
2016-09-07 15:39 ` Chen Gang
2016-09-17 6:33 ` Chen Gang
2016-09-17 6:33 ` Chen Gang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.