tree:
https://github.com/c-sky/csky-linux v5.12-rc4-riscv-atomic-arch-v2
head: ba97cb573d12789863827bd2af6f3ccd6fdcaf19
commit: 088b40fee0c85e4837c2208142a4d8d4825395a5 [4/5] locking/atomics: Fixup
GENERIC_ATOMIC64 conflict with atomic-arch-fallback.h
config: arc-randconfig-r033-20210416 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/c-sky/csky-linux/commit/088b40fee0c85e4837c2208142a4d8...
git remote add csky-linux
https://github.com/c-sky/csky-linux
git fetch --no-tags csky-linux v5.12-rc4-riscv-atomic-arch-v2
git checkout 088b40fee0c85e4837c2208142a4d8d4825395a5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/init.h:5,
from lib/atomic64_test.c:10:
lib/atomic64_test.c: In function 'test_atomic64':
> lib/atomic64_test.c:49:9: error: implicit declaration of function
'atomic64_sub_return_acquire'; did you mean 'atomic_sub_return_acquire'?
[-Werror=implicit-function-declaration]
49 | BUG_ON(atomic##bit##_##op(val,
&v) != r); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:49:2: note: in expansion of macro 'BUG_ON'
49 | BUG_ON(atomic##bit##_##op(val, &v) != r); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_RETURN'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:64:2: note: in expansion of macro 'FAMILY_TEST'
64 | FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:177:2: note: in expansion of macro 'RETURN_FAMILY_TEST'
177 | RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
| ^~~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:49:9: error: implicit declaration of function
'atomic64_sub_return_release'; did you mean 'atomic_sub_return_release'?
[-Werror=implicit-function-declaration]
49 | BUG_ON(atomic##bit##_##op(val,
&v) != r); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:49:2: note: in expansion of macro 'BUG_ON'
49 | BUG_ON(atomic##bit##_##op(val, &v) != r); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_RETURN'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:64:2: note: in expansion of macro 'FAMILY_TEST'
64 | FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:177:2: note: in expansion of macro 'RETURN_FAMILY_TEST'
177 | RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
| ^~~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:49:9: error: implicit declaration of function
'atomic64_sub_return_relaxed'; did you mean 'atomic_sub_return_relaxed'?
[-Werror=implicit-function-declaration]
49 | BUG_ON(atomic##bit##_##op(val,
&v) != r); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:49:2: note: in expansion of macro 'BUG_ON'
49 | BUG_ON(atomic##bit##_##op(val, &v) != r); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_RETURN'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:64:2: note: in expansion of macro 'FAMILY_TEST'
64 | FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:177:2: note: in expansion of macro 'RETURN_FAMILY_TEST'
177 | RETURN_FAMILY_TEST(64, sub_return, -=, onestwos);
| ^~~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_sub_acquire'; did you mean 'atomic_fetch_sub_acquire'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_FETCH'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:182:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
182 | FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_sub_release'; did you mean 'atomic_fetch_sub_release'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_FETCH'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:182:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
182 | FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_sub_relaxed'; did you mean 'atomic_fetch_sub_relaxed'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_FETCH'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:182:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
182 | FETCH_FAMILY_TEST(64, fetch_sub, -=, onestwos);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_or_acquire'; did you mean 'atomic_fetch_or_acquire'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_FETCH'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:185:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
185 | FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_or_release'; did you mean 'atomic_fetch_or_release'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_FETCH'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:185:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
185 | FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_or_relaxed'; did you mean 'atomic_fetch_or_relaxed'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_FETCH'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:185:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
185 | FETCH_FAMILY_TEST(64, fetch_or, |=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_and_acquire'; did you mean 'atomic64_fetch_add_acquire'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_FETCH'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:186:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
186 | FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_and_release'; did you mean 'atomic64_fetch_add_release'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_FETCH'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:186:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
186 | FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_and_relaxed'; did you mean 'atomic64_fetch_add_relaxed'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_FETCH'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:186:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
186 | FETCH_FAMILY_TEST(64, fetch_and, &=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_andnot_acquire'; did you mean
'atomic_fetch_andnot_acquire'? [-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_FETCH'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:187:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
187 | FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_andnot_release'; did you mean
'atomic_fetch_andnot_release'? [-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_FETCH'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:187:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
187 | FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_andnot_relaxed'; did you mean
'atomic_fetch_andnot_relaxed'? [-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_FETCH'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:187:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
187 | FETCH_FAMILY_TEST(64, fetch_andnot, &= ~, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_xor_acquire'; did you mean 'atomic_fetch_xor_acquire'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_FETCH'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:188:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
188 | FETCH_FAMILY_TEST(64, fetch_xor, ^=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_xor_release'; did you mean 'atomic_fetch_xor_release'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_FETCH'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:188:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
188 | FETCH_FAMILY_TEST(64, fetch_xor, ^=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:58:9: error: implicit declaration of function
'atomic64_fetch_xor_relaxed'; did you mean 'atomic_fetch_xor_relaxed'?
[-Werror=implicit-function-declaration]
58 | BUG_ON(atomic##bit##_##op(val,
&v) != v0); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:58:2: note: in expansion of macro 'BUG_ON'
58 | BUG_ON(atomic##bit##_##op(val, &v) != v0); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_FETCH'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:69:2: note: in expansion of macro 'FAMILY_TEST'
69 | FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
| ^~~~~~~~~~~
lib/atomic64_test.c:188:2: note: in expansion of macro 'FETCH_FAMILY_TEST'
188 | FETCH_FAMILY_TEST(64, fetch_xor, ^=, v1);
| ^~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_inc_return_acquire'; did you mean 'atomic_inc_return_acquire'?
[-Werror=implicit-function-declaration]
75 |
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:94:2: note: in expansion of macro 'FAMILY_TEST'
94 | FAMILY_TEST(TEST_ARGS, bit, inc_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:200:2: note: in expansion of macro
'INC_RETURN_FAMILY_TEST'
200 | INC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
> lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_inc_return_release'; did you mean 'atomic_inc_return_release'?
[-Werror=implicit-function-declaration]
75 |
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_ARGS'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:94:2: note: in expansion of macro 'FAMILY_TEST'
94 | FAMILY_TEST(TEST_ARGS, bit, inc_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:200:2: note: in expansion of macro
'INC_RETURN_FAMILY_TEST'
200 | INC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_inc_return_relaxed'; did you mean 'atomic_inc_return_relaxed'?
[-Werror=implicit-function-declaration]
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_ARGS'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:94:2: note: in expansion of macro 'FAMILY_TEST'
94 | FAMILY_TEST(TEST_ARGS, bit, inc_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:200:2: note: in expansion of macro
'INC_RETURN_FAMILY_TEST'
200 | INC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_dec_return_acquire'; did you mean 'atomic_dec_return_acquire'?
[-Werror=implicit-function-declaration]
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:39:2: note: in expansion of macro 'TEST_ARGS'
39 | test(bit, op##_acquire, ##args); \
| ^~~~
lib/atomic64_test.c:100:2: note: in expansion of macro 'FAMILY_TEST'
100 | FAMILY_TEST(TEST_ARGS, bit, dec_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:201:2: note: in expansion of macro
'DEC_RETURN_FAMILY_TEST'
201 | DEC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_dec_return_release'; did you mean 'atomic_dec_return_release'?
[-Werror=implicit-function-declaration]
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:40:2: note: in expansion of macro 'TEST_ARGS'
40 | test(bit, op##_release, ##args); \
| ^~~~
lib/atomic64_test.c:100:2: note: in expansion of macro 'FAMILY_TEST'
100 | FAMILY_TEST(TEST_ARGS, bit, dec_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:201:2: note: in expansion of macro
'DEC_RETURN_FAMILY_TEST'
201 | DEC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/atomic64_test.c:75:9: error: implicit declaration of function
'atomic64_dec_return_relaxed'; did you mean 'atomic_dec_return_relaxed'?
[-Werror=implicit-function-declaration]
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:75:2: note: in expansion of macro 'BUG_ON'
75 | BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
| ^~~~~~
lib/atomic64_test.c:41:2: note: in expansion of macro 'TEST_ARGS'
41 | test(bit, op##_relaxed, ##args); \
| ^~~~
lib/atomic64_test.c:100:2: note: in expansion of macro 'FAMILY_TEST'
100 | FAMILY_TEST(TEST_ARGS, bit, dec_return, \
| ^~~~~~~~~~~
lib/atomic64_test.c:201:2: note: in expansion of macro
'DEC_RETURN_FAMILY_TEST'
201 | DEC_RETURN_FAMILY_TEST(64, v0);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/atomic64_test.c:207:9: error: implicit declaration of function
'atomic64_add_unless'; did you mean 'atomic_add_unless'?
[-Werror=implicit-function-declaration]
207 | BUG_ON(atomic64_add_unless(&v, one, v0));
| ^~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
lib/atomic64_test.c:207:2: note: in expansion of macro 'BUG_ON'
207 | BUG_ON(atomic64_add_unless(&v, one, v0));
| ^~~~~~
lib/atomic64_test.c:229:10: error: implicit declaration of function
'atomic64_inc_not_zero'; did you mean 'atomic_inc_not_zero'?
[-Werror=implicit-function-declaration]
229 | BUG_ON(!atomic64_inc_not_zero(&v));
vim +58 lib/atomic64_test.c
978e5a3692c3b6 Boqun Feng 2015-11-04 43
978e5a3692c3b6 Boqun Feng 2015-11-04 44 #define TEST_RETURN(bit, op, c_op,
val) \
978e5a3692c3b6 Boqun Feng 2015-11-04 45 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 46 atomic##bit##_set(&v, v0); \
978e5a3692c3b6 Boqun Feng 2015-11-04 47 r = v0; \
978e5a3692c3b6 Boqun Feng 2015-11-04 48 r c_op val; \
978e5a3692c3b6 Boqun Feng 2015-11-04 @49 BUG_ON(atomic##bit##_##op(val, &v)
!= r); \
978e5a3692c3b6 Boqun Feng 2015-11-04 50 BUG_ON(atomic##bit##_read(&v) !=
r); \
978e5a3692c3b6 Boqun Feng 2015-11-04 51 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 52
28aa2bda2211f4 Peter Zijlstra 2016-04-18 53 #define TEST_FETCH(bit, op, c_op,
val) \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 54 do { \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 55 atomic##bit##_set(&v, v0); \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 56 r = v0; \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 57 r c_op val; \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 @58 BUG_ON(atomic##bit##_##op(val, &v)
!= v0); \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 59 BUG_ON(atomic##bit##_read(&v) !=
r); \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 60 } while (0)
28aa2bda2211f4 Peter Zijlstra 2016-04-18 61
978e5a3692c3b6 Boqun Feng 2015-11-04 62 #define RETURN_FAMILY_TEST(bit, op, c_op,
val) \
978e5a3692c3b6 Boqun Feng 2015-11-04 63 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 64 FAMILY_TEST(TEST_RETURN, bit, op, c_op,
val); \
978e5a3692c3b6 Boqun Feng 2015-11-04 65 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 66
28aa2bda2211f4 Peter Zijlstra 2016-04-18 67 #define FETCH_FAMILY_TEST(bit, op, c_op,
val) \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 68 do { \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 69 FAMILY_TEST(TEST_FETCH, bit, op, c_op,
val); \
28aa2bda2211f4 Peter Zijlstra 2016-04-18 70 } while (0)
28aa2bda2211f4 Peter Zijlstra 2016-04-18 71
978e5a3692c3b6 Boqun Feng 2015-11-04 72 #define TEST_ARGS(bit, op, init, ret,
expect, args...) \
978e5a3692c3b6 Boqun Feng 2015-11-04 73 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 74 atomic##bit##_set(&v, init); \
978e5a3692c3b6 Boqun Feng 2015-11-04 @75 BUG_ON(atomic##bit##_##op(&v,
##args) != ret); \
978e5a3692c3b6 Boqun Feng 2015-11-04 76 BUG_ON(atomic##bit##_read(&v) !=
expect); \
978e5a3692c3b6 Boqun Feng 2015-11-04 77 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 78
978e5a3692c3b6 Boqun Feng 2015-11-04 79 #define XCHG_FAMILY_TEST(bit, init,
new) \
978e5a3692c3b6 Boqun Feng 2015-11-04 80 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 81 FAMILY_TEST(TEST_ARGS, bit, xchg, init,
init, new, new); \
978e5a3692c3b6 Boqun Feng 2015-11-04 82 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 83
978e5a3692c3b6 Boqun Feng 2015-11-04 84 #define CMPXCHG_FAMILY_TEST(bit, init,
new, wrong) \
978e5a3692c3b6 Boqun Feng 2015-11-04 85 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 86 FAMILY_TEST(TEST_ARGS, bit, cmpxchg,
\
978e5a3692c3b6 Boqun Feng 2015-11-04 87 init, init, new, init, new); \
978e5a3692c3b6 Boqun Feng 2015-11-04 88 FAMILY_TEST(TEST_ARGS, bit,
cmpxchg, \
978e5a3692c3b6 Boqun Feng 2015-11-04 89 init, init, init, wrong, new); \
978e5a3692c3b6 Boqun Feng 2015-11-04 90 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 91
978e5a3692c3b6 Boqun Feng 2015-11-04 92 #define INC_RETURN_FAMILY_TEST(bit,
i) \
978e5a3692c3b6 Boqun Feng 2015-11-04 93 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 94 FAMILY_TEST(TEST_ARGS, bit,
inc_return, \
978e5a3692c3b6 Boqun Feng 2015-11-04 95 i, (i) + one, (i) + one); \
978e5a3692c3b6 Boqun Feng 2015-11-04 96 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 97
978e5a3692c3b6 Boqun Feng 2015-11-04 98 #define DEC_RETURN_FAMILY_TEST(bit,
i) \
978e5a3692c3b6 Boqun Feng 2015-11-04 99 do { \
978e5a3692c3b6 Boqun Feng 2015-11-04 100 FAMILY_TEST(TEST_ARGS, bit,
dec_return, \
978e5a3692c3b6 Boqun Feng 2015-11-04 101 i, (i) - one, (i) - one); \
978e5a3692c3b6 Boqun Feng 2015-11-04 102 } while (0)
978e5a3692c3b6 Boqun Feng 2015-11-04 103
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 104 static __init void test_atomic(void)
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 105 {
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 106 int v0 = 0xaaa31337;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 107 int v1 = 0xdeadbeef;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 108 int onestwos = 0x11112222;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 109 int one = 1;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 110
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 111 atomic_t v;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 112 int r;
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 113
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 114 TEST(, add, +=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 115 TEST(, add, +=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 116 TEST(, sub, -=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 117 TEST(, sub, -=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 118 TEST(, or, |=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 119 TEST(, and, &=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 120 TEST(, xor, ^=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 121 TEST(, andnot, &= ~, v1);
978e5a3692c3b6 Boqun Feng 2015-11-04 122
978e5a3692c3b6 Boqun Feng 2015-11-04 123 RETURN_FAMILY_TEST(, add_return, +=,
onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 124 RETURN_FAMILY_TEST(, add_return, +=,
-one);
978e5a3692c3b6 Boqun Feng 2015-11-04 125 RETURN_FAMILY_TEST(, sub_return, -=,
onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 126 RETURN_FAMILY_TEST(, sub_return, -=,
-one);
978e5a3692c3b6 Boqun Feng 2015-11-04 127
28aa2bda2211f4 Peter Zijlstra 2016-04-18 128 FETCH_FAMILY_TEST(, fetch_add, +=,
onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 129 FETCH_FAMILY_TEST(, fetch_add, +=,
-one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 130 FETCH_FAMILY_TEST(, fetch_sub, -=,
onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 131 FETCH_FAMILY_TEST(, fetch_sub, -=,
-one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 132
28aa2bda2211f4 Peter Zijlstra 2016-04-18 133 FETCH_FAMILY_TEST(, fetch_or, |=, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 134 FETCH_FAMILY_TEST(, fetch_and, &=,
v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 135 FETCH_FAMILY_TEST(, fetch_andnot, &=
~, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 136 FETCH_FAMILY_TEST(, fetch_xor, ^=, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 137
978e5a3692c3b6 Boqun Feng 2015-11-04 138 INC_RETURN_FAMILY_TEST(, v0);
978e5a3692c3b6 Boqun Feng 2015-11-04 139 DEC_RETURN_FAMILY_TEST(, v0);
978e5a3692c3b6 Boqun Feng 2015-11-04 140
978e5a3692c3b6 Boqun Feng 2015-11-04 141 XCHG_FAMILY_TEST(, v0, v1);
978e5a3692c3b6 Boqun Feng 2015-11-04 142 CMPXCHG_FAMILY_TEST(, v0, v1,
onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 143
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 144 }
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 145
86a8938078a8bb Luca Barbieri 2010-02-24 146 #define INIT(c) do { atomic64_set(&v,
c); r = c; } while (0)
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 147 static __init void test_atomic64(void)
86a8938078a8bb Luca Barbieri 2010-02-24 148 {
86a8938078a8bb Luca Barbieri 2010-02-24 149 long long v0 = 0xaaa31337c001d00dLL;
86a8938078a8bb Luca Barbieri 2010-02-24 150 long long v1 = 0xdeadbeefdeafcafeLL;
86a8938078a8bb Luca Barbieri 2010-02-24 151 long long v2 = 0xfaceabadf00df001LL;
ffba19ccae8d98 Michael Ellerman 2017-07-14 152 long long v3 = 0x8000000000000000LL;
86a8938078a8bb Luca Barbieri 2010-02-24 153 long long onestwos =
0x1111111122222222LL;
86a8938078a8bb Luca Barbieri 2010-02-24 154 long long one = 1LL;
ffba19ccae8d98 Michael Ellerman 2017-07-14 155 int r_int;
86a8938078a8bb Luca Barbieri 2010-02-24 156
86a8938078a8bb Luca Barbieri 2010-02-24 157 atomic64_t v = ATOMIC64_INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 158 long long r = v0;
86a8938078a8bb Luca Barbieri 2010-02-24 159 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 160
86a8938078a8bb Luca Barbieri 2010-02-24 161 atomic64_set(&v, v1);
86a8938078a8bb Luca Barbieri 2010-02-24 162 r = v1;
86a8938078a8bb Luca Barbieri 2010-02-24 163 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 164 BUG_ON(atomic64_read(&v) != r);
86a8938078a8bb Luca Barbieri 2010-02-24 165
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 166 TEST(64, add, +=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 167 TEST(64, add, +=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 168 TEST(64, sub, -=, onestwos);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 169 TEST(64, sub, -=, -one);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 170 TEST(64, or, |=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 171 TEST(64, and, &=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 172 TEST(64, xor, ^=, v1);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 173 TEST(64, andnot, &= ~, v1);
86a8938078a8bb Luca Barbieri 2010-02-24 174
978e5a3692c3b6 Boqun Feng 2015-11-04 175 RETURN_FAMILY_TEST(64, add_return, +=,
onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 176 RETURN_FAMILY_TEST(64, add_return, +=,
-one);
978e5a3692c3b6 Boqun Feng 2015-11-04 177 RETURN_FAMILY_TEST(64, sub_return, -=,
onestwos);
978e5a3692c3b6 Boqun Feng 2015-11-04 178 RETURN_FAMILY_TEST(64, sub_return, -=,
-one);
86a8938078a8bb Luca Barbieri 2010-02-24 179
28aa2bda2211f4 Peter Zijlstra 2016-04-18 180 FETCH_FAMILY_TEST(64, fetch_add, +=,
onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 181 FETCH_FAMILY_TEST(64, fetch_add, +=,
-one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 182 FETCH_FAMILY_TEST(64, fetch_sub, -=,
onestwos);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 183 FETCH_FAMILY_TEST(64, fetch_sub, -=,
-one);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 184
28aa2bda2211f4 Peter Zijlstra 2016-04-18 185 FETCH_FAMILY_TEST(64, fetch_or, |=,
v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 186 FETCH_FAMILY_TEST(64, fetch_and, &=,
v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 187 FETCH_FAMILY_TEST(64, fetch_andnot,
&= ~, v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 188 FETCH_FAMILY_TEST(64, fetch_xor, ^=,
v1);
28aa2bda2211f4 Peter Zijlstra 2016-04-18 189
86a8938078a8bb Luca Barbieri 2010-02-24 190 INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 191 atomic64_inc(&v);
86a8938078a8bb Luca Barbieri 2010-02-24 192 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 193 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 194
86a8938078a8bb Luca Barbieri 2010-02-24 195 INIT(v0);
86a8938078a8bb Luca Barbieri 2010-02-24 196 atomic64_dec(&v);
86a8938078a8bb Luca Barbieri 2010-02-24 197 r -= one;
86a8938078a8bb Luca Barbieri 2010-02-24 198 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 199
978e5a3692c3b6 Boqun Feng 2015-11-04 200 INC_RETURN_FAMILY_TEST(64, v0);
978e5a3692c3b6 Boqun Feng 2015-11-04 201 DEC_RETURN_FAMILY_TEST(64, v0);
86a8938078a8bb Luca Barbieri 2010-02-24 202
978e5a3692c3b6 Boqun Feng 2015-11-04 203 XCHG_FAMILY_TEST(64, v0, v1);
978e5a3692c3b6 Boqun Feng 2015-11-04 204 CMPXCHG_FAMILY_TEST(64, v0, v1, v2);
86a8938078a8bb Luca Barbieri 2010-02-24 205
86a8938078a8bb Luca Barbieri 2010-02-24 206 INIT(v0);
9efbcd59024304 Luca Barbieri 2010-03-01 @207 BUG_ON(atomic64_add_unless(&v, one,
v0));
86a8938078a8bb Luca Barbieri 2010-02-24 208 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 209
86a8938078a8bb Luca Barbieri 2010-02-24 210 INIT(v0);
9efbcd59024304 Luca Barbieri 2010-03-01 211 BUG_ON(!atomic64_add_unless(&v, one,
v1));
86a8938078a8bb Luca Barbieri 2010-02-24 212 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 213 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 214
86a8938078a8bb Luca Barbieri 2010-02-24 215 INIT(onestwos);
86a8938078a8bb Luca Barbieri 2010-02-24 216 BUG_ON(atomic64_dec_if_positive(&v)
!= (onestwos - 1));
86a8938078a8bb Luca Barbieri 2010-02-24 217 r -= one;
86a8938078a8bb Luca Barbieri 2010-02-24 218 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 219
86a8938078a8bb Luca Barbieri 2010-02-24 220 INIT(0);
86a8938078a8bb Luca Barbieri 2010-02-24 221 BUG_ON(atomic64_dec_if_positive(&v)
!= -one);
86a8938078a8bb Luca Barbieri 2010-02-24 222 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 223
86a8938078a8bb Luca Barbieri 2010-02-24 224 INIT(-one);
86a8938078a8bb Luca Barbieri 2010-02-24 225 BUG_ON(atomic64_dec_if_positive(&v)
!= (-one - one));
86a8938078a8bb Luca Barbieri 2010-02-24 226 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 227
86a8938078a8bb Luca Barbieri 2010-02-24 228 INIT(onestwos);
25a304f277ad70 Luca Barbieri 2010-03-01 @229 BUG_ON(!atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 230 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 231 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 232
86a8938078a8bb Luca Barbieri 2010-02-24 233 INIT(0);
25a304f277ad70 Luca Barbieri 2010-03-01 234 BUG_ON(atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 235 BUG_ON(v.counter != r);
86a8938078a8bb Luca Barbieri 2010-02-24 236
86a8938078a8bb Luca Barbieri 2010-02-24 237 INIT(-one);
25a304f277ad70 Luca Barbieri 2010-03-01 238 BUG_ON(!atomic64_inc_not_zero(&v));
86a8938078a8bb Luca Barbieri 2010-02-24 239 r += one;
86a8938078a8bb Luca Barbieri 2010-02-24 240 BUG_ON(v.counter != r);
ffba19ccae8d98 Michael Ellerman 2017-07-14 241
ffba19ccae8d98 Michael Ellerman 2017-07-14 242 /* Confirm the return value fits in an
int, even if the value doesn't */
ffba19ccae8d98 Michael Ellerman 2017-07-14 243 INIT(v3);
ffba19ccae8d98 Michael Ellerman 2017-07-14 244 r_int = atomic64_inc_not_zero(&v);
ffba19ccae8d98 Michael Ellerman 2017-07-14 245 BUG_ON(!r_int);
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 246 }
41b9e9fcc1c44b Peter Zijlstra 2015-07-13 247
:::::: The code at line 58 was first introduced by commit
:::::: 28aa2bda2211f4327d83b44a4f917b4a061b1c56 locking/atomic: Implement
atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org