[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201805070137.unbVGENS%fengguang.wu@intel.com>
Date: Mon, 7 May 2018 01:49:39 +0800
From: kbuild test robot <lkp@...el.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: kbuild-all@...org, linux-kernel@...r.kernel.org, tipbuild@...or.com
Subject: [tip:locking/core 5/7] lib/atomic64_test.c:79:9: error: implicit
declaration of function 'atomic_xchg_acquire'; did you mean
'atomic_cmpxchg_acquire'?
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head: ad6812db385540eb2457c945a8e95fc9095b706c
commit: 87d655a48dfe74293f72dc001ed042142cf00d44 [5/7] locking/atomics: Simplify the op definitions in atomic.h some more
config: powerpc-allmodconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 87d655a48dfe74293f72dc001ed042142cf00d44
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All error/warnings (new ones prefixed by >>):
In file included from include/linux/bug.h:5:0,
from lib/atomic64_test.c:15:
lib/atomic64_test.c: In function 'test_atomic':
>> lib/atomic64_test.c:79:9: error: implicit declaration of function 'atomic_xchg_acquire'; did you mean 'atomic_cmpxchg_acquire'? [-Werror=implicit-function-declaration]
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
^
arch/powerpc/include/asm/bug.h:76:27: note: in definition of macro 'BUG_ON'
if (__builtin_constant_p(x)) { \
^
>> lib/atomic64_test.c:43:2: note: in expansion of macro 'TEST_ARGS'
test(bit, op##_acquire, ##args); \
^~~~
>> lib/atomic64_test.c:85:2: note: in expansion of macro 'FAMILY_TEST'
FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new); \
^~~~~~~~~~~
>> lib/atomic64_test.c:145:2: note: in expansion of macro 'XCHG_FAMILY_TEST'
XCHG_FAMILY_TEST(, v0, v1);
^~~~~~~~~~~~~~~~
>> lib/atomic64_test.c:79:9: error: implicit declaration of function 'atomic_xchg_release'; did you mean 'atomic_cmpxchg_release'? [-Werror=implicit-function-declaration]
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
^
arch/powerpc/include/asm/bug.h:76:27: note: in definition of macro 'BUG_ON'
if (__builtin_constant_p(x)) { \
^
lib/atomic64_test.c:44:2: note: in expansion of macro 'TEST_ARGS'
test(bit, op##_release, ##args); \
^~~~
>> lib/atomic64_test.c:85:2: note: in expansion of macro 'FAMILY_TEST'
FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new); \
^~~~~~~~~~~
>> lib/atomic64_test.c:145:2: note: in expansion of macro 'XCHG_FAMILY_TEST'
XCHG_FAMILY_TEST(, v0, v1);
^~~~~~~~~~~~~~~~
lib/atomic64_test.c: In function 'test_atomic64':
>> lib/atomic64_test.c:79:9: error: implicit declaration of function 'atomic64_xchg_acquire'; did you mean 'atomic64_cmpxchg_acquire'? [-Werror=implicit-function-declaration]
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
^
arch/powerpc/include/asm/bug.h:76:27: note: in definition of macro 'BUG_ON'
if (__builtin_constant_p(x)) { \
^
>> lib/atomic64_test.c:43:2: note: in expansion of macro 'TEST_ARGS'
test(bit, op##_acquire, ##args); \
^~~~
>> lib/atomic64_test.c:85:2: note: in expansion of macro 'FAMILY_TEST'
FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new); \
^~~~~~~~~~~
lib/atomic64_test.c:207:2: note: in expansion of macro 'XCHG_FAMILY_TEST'
XCHG_FAMILY_TEST(64, v0, v1);
^~~~~~~~~~~~~~~~
>> lib/atomic64_test.c:79:9: error: implicit declaration of function 'atomic64_xchg_release'; did you mean 'atomic64_cmpxchg_release'? [-Werror=implicit-function-declaration]
BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
^
arch/powerpc/include/asm/bug.h:76:27: note: in definition of macro 'BUG_ON'
if (__builtin_constant_p(x)) { \
^
lib/atomic64_test.c:44:2: note: in expansion of macro 'TEST_ARGS'
test(bit, op##_release, ##args); \
^~~~
>> lib/atomic64_test.c:85:2: note: in expansion of macro 'FAMILY_TEST'
FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new); \
^~~~~~~~~~~
lib/atomic64_test.c:207:2: note: in expansion of macro 'XCHG_FAMILY_TEST'
XCHG_FAMILY_TEST(64, v0, v1);
^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +79 lib/atomic64_test.c
b3b16d284 Fabian Frederick 2014-06-04 13
86a893807 Luca Barbieri 2010-02-24 14 #include <linux/init.h>
50af5ead3 Paul Gortmaker 2012-01-20 @15 #include <linux/bug.h>
0dbdd1bfe Peter Huewe 2010-05-24 16 #include <linux/kernel.h>
60063497a Arun Sharma 2011-07-26 17 #include <linux/atomic.h>
55ded9551 Geert Uytterhoeven 2017-02-24 18 #include <linux/module.h>
86a893807 Luca Barbieri 2010-02-24 19
153a4334c Andi Kleen 2015-12-01 20 #ifdef CONFIG_X86
cd4d09ec6 Borislav Petkov 2016-01-26 21 #include <asm/cpufeature.h> /* for boot_cpu_has below */
153a4334c Andi Kleen 2015-12-01 22 #endif
153a4334c Andi Kleen 2015-12-01 23
41b9e9fcc Peter Zijlstra 2015-07-13 24 #define TEST(bit, op, c_op, val) \
41b9e9fcc Peter Zijlstra 2015-07-13 25 do { \
41b9e9fcc Peter Zijlstra 2015-07-13 26 atomic##bit##_set(&v, v0); \
41b9e9fcc Peter Zijlstra 2015-07-13 27 r = v0; \
41b9e9fcc Peter Zijlstra 2015-07-13 28 atomic##bit##_##op(val, &v); \
41b9e9fcc Peter Zijlstra 2015-07-13 29 r c_op val; \
41b9e9fcc Peter Zijlstra 2015-07-13 30 WARN(atomic##bit##_read(&v) != r, "%Lx != %Lx\n", \
41b9e9fcc Peter Zijlstra 2015-07-13 31 (unsigned long long)atomic##bit##_read(&v), \
41b9e9fcc Peter Zijlstra 2015-07-13 32 (unsigned long long)r); \
41b9e9fcc Peter Zijlstra 2015-07-13 33 } while (0)
41b9e9fcc Peter Zijlstra 2015-07-13 34
978e5a369 Boqun Feng 2015-11-04 35 /*
978e5a369 Boqun Feng 2015-11-04 36 * Test for a atomic operation family,
978e5a369 Boqun Feng 2015-11-04 37 * @test should be a macro accepting parameters (bit, op, ...)
978e5a369 Boqun Feng 2015-11-04 38 */
978e5a369 Boqun Feng 2015-11-04 39
978e5a369 Boqun Feng 2015-11-04 40 #define FAMILY_TEST(test, bit, op, args...) \
978e5a369 Boqun Feng 2015-11-04 41 do { \
978e5a369 Boqun Feng 2015-11-04 42 test(bit, op, ##args); \
978e5a369 Boqun Feng 2015-11-04 @43 test(bit, op##_acquire, ##args); \
978e5a369 Boqun Feng 2015-11-04 44 test(bit, op##_release, ##args); \
978e5a369 Boqun Feng 2015-11-04 45 test(bit, op##_relaxed, ##args); \
978e5a369 Boqun Feng 2015-11-04 46 } while (0)
978e5a369 Boqun Feng 2015-11-04 47
978e5a369 Boqun Feng 2015-11-04 48 #define TEST_RETURN(bit, op, c_op, val) \
978e5a369 Boqun Feng 2015-11-04 49 do { \
978e5a369 Boqun Feng 2015-11-04 50 atomic##bit##_set(&v, v0); \
978e5a369 Boqun Feng 2015-11-04 51 r = v0; \
978e5a369 Boqun Feng 2015-11-04 52 r c_op val; \
978e5a369 Boqun Feng 2015-11-04 53 BUG_ON(atomic##bit##_##op(val, &v) != r); \
978e5a369 Boqun Feng 2015-11-04 54 BUG_ON(atomic##bit##_read(&v) != r); \
978e5a369 Boqun Feng 2015-11-04 55 } while (0)
978e5a369 Boqun Feng 2015-11-04 56
28aa2bda2 Peter Zijlstra 2016-04-18 57 #define TEST_FETCH(bit, op, c_op, val) \
28aa2bda2 Peter Zijlstra 2016-04-18 58 do { \
28aa2bda2 Peter Zijlstra 2016-04-18 59 atomic##bit##_set(&v, v0); \
28aa2bda2 Peter Zijlstra 2016-04-18 60 r = v0; \
28aa2bda2 Peter Zijlstra 2016-04-18 61 r c_op val; \
28aa2bda2 Peter Zijlstra 2016-04-18 62 BUG_ON(atomic##bit##_##op(val, &v) != v0); \
28aa2bda2 Peter Zijlstra 2016-04-18 63 BUG_ON(atomic##bit##_read(&v) != r); \
28aa2bda2 Peter Zijlstra 2016-04-18 64 } while (0)
28aa2bda2 Peter Zijlstra 2016-04-18 65
978e5a369 Boqun Feng 2015-11-04 66 #define RETURN_FAMILY_TEST(bit, op, c_op, val) \
978e5a369 Boqun Feng 2015-11-04 67 do { \
978e5a369 Boqun Feng 2015-11-04 68 FAMILY_TEST(TEST_RETURN, bit, op, c_op, val); \
978e5a369 Boqun Feng 2015-11-04 69 } while (0)
978e5a369 Boqun Feng 2015-11-04 70
28aa2bda2 Peter Zijlstra 2016-04-18 71 #define FETCH_FAMILY_TEST(bit, op, c_op, val) \
28aa2bda2 Peter Zijlstra 2016-04-18 72 do { \
28aa2bda2 Peter Zijlstra 2016-04-18 73 FAMILY_TEST(TEST_FETCH, bit, op, c_op, val); \
28aa2bda2 Peter Zijlstra 2016-04-18 74 } while (0)
28aa2bda2 Peter Zijlstra 2016-04-18 75
978e5a369 Boqun Feng 2015-11-04 76 #define TEST_ARGS(bit, op, init, ret, expect, args...) \
978e5a369 Boqun Feng 2015-11-04 77 do { \
978e5a369 Boqun Feng 2015-11-04 78 atomic##bit##_set(&v, init); \
978e5a369 Boqun Feng 2015-11-04 @79 BUG_ON(atomic##bit##_##op(&v, ##args) != ret); \
978e5a369 Boqun Feng 2015-11-04 80 BUG_ON(atomic##bit##_read(&v) != expect); \
978e5a369 Boqun Feng 2015-11-04 81 } while (0)
978e5a369 Boqun Feng 2015-11-04 82
978e5a369 Boqun Feng 2015-11-04 83 #define XCHG_FAMILY_TEST(bit, init, new) \
978e5a369 Boqun Feng 2015-11-04 84 do { \
978e5a369 Boqun Feng 2015-11-04 @85 FAMILY_TEST(TEST_ARGS, bit, xchg, init, init, new, new); \
978e5a369 Boqun Feng 2015-11-04 86 } while (0)
978e5a369 Boqun Feng 2015-11-04 87
978e5a369 Boqun Feng 2015-11-04 88 #define CMPXCHG_FAMILY_TEST(bit, init, new, wrong) \
978e5a369 Boqun Feng 2015-11-04 89 do { \
978e5a369 Boqun Feng 2015-11-04 90 FAMILY_TEST(TEST_ARGS, bit, cmpxchg, \
978e5a369 Boqun Feng 2015-11-04 91 init, init, new, init, new); \
978e5a369 Boqun Feng 2015-11-04 92 FAMILY_TEST(TEST_ARGS, bit, cmpxchg, \
978e5a369 Boqun Feng 2015-11-04 93 init, init, init, wrong, new); \
978e5a369 Boqun Feng 2015-11-04 94 } while (0)
978e5a369 Boqun Feng 2015-11-04 95
978e5a369 Boqun Feng 2015-11-04 96 #define INC_RETURN_FAMILY_TEST(bit, i) \
978e5a369 Boqun Feng 2015-11-04 97 do { \
978e5a369 Boqun Feng 2015-11-04 98 FAMILY_TEST(TEST_ARGS, bit, inc_return, \
978e5a369 Boqun Feng 2015-11-04 99 i, (i) + one, (i) + one); \
978e5a369 Boqun Feng 2015-11-04 100 } while (0)
978e5a369 Boqun Feng 2015-11-04 101
978e5a369 Boqun Feng 2015-11-04 102 #define DEC_RETURN_FAMILY_TEST(bit, i) \
978e5a369 Boqun Feng 2015-11-04 103 do { \
978e5a369 Boqun Feng 2015-11-04 104 FAMILY_TEST(TEST_ARGS, bit, dec_return, \
978e5a369 Boqun Feng 2015-11-04 105 i, (i) - one, (i) - one); \
978e5a369 Boqun Feng 2015-11-04 106 } while (0)
978e5a369 Boqun Feng 2015-11-04 107
41b9e9fcc Peter Zijlstra 2015-07-13 108 static __init void test_atomic(void)
41b9e9fcc Peter Zijlstra 2015-07-13 109 {
41b9e9fcc Peter Zijlstra 2015-07-13 110 int v0 = 0xaaa31337;
41b9e9fcc Peter Zijlstra 2015-07-13 111 int v1 = 0xdeadbeef;
41b9e9fcc Peter Zijlstra 2015-07-13 112 int onestwos = 0x11112222;
41b9e9fcc Peter Zijlstra 2015-07-13 113 int one = 1;
41b9e9fcc Peter Zijlstra 2015-07-13 114
41b9e9fcc Peter Zijlstra 2015-07-13 115 atomic_t v;
41b9e9fcc Peter Zijlstra 2015-07-13 116 int r;
41b9e9fcc Peter Zijlstra 2015-07-13 117
41b9e9fcc Peter Zijlstra 2015-07-13 118 TEST(, add, +=, onestwos);
41b9e9fcc Peter Zijlstra 2015-07-13 119 TEST(, add, +=, -one);
41b9e9fcc Peter Zijlstra 2015-07-13 120 TEST(, sub, -=, onestwos);
41b9e9fcc Peter Zijlstra 2015-07-13 121 TEST(, sub, -=, -one);
41b9e9fcc Peter Zijlstra 2015-07-13 122 TEST(, or, |=, v1);
41b9e9fcc Peter Zijlstra 2015-07-13 123 TEST(, and, &=, v1);
41b9e9fcc Peter Zijlstra 2015-07-13 124 TEST(, xor, ^=, v1);
41b9e9fcc Peter Zijlstra 2015-07-13 125 TEST(, andnot, &= ~, v1);
978e5a369 Boqun Feng 2015-11-04 126
978e5a369 Boqun Feng 2015-11-04 127 RETURN_FAMILY_TEST(, add_return, +=, onestwos);
978e5a369 Boqun Feng 2015-11-04 128 RETURN_FAMILY_TEST(, add_return, +=, -one);
978e5a369 Boqun Feng 2015-11-04 129 RETURN_FAMILY_TEST(, sub_return, -=, onestwos);
978e5a369 Boqun Feng 2015-11-04 130 RETURN_FAMILY_TEST(, sub_return, -=, -one);
978e5a369 Boqun Feng 2015-11-04 131
28aa2bda2 Peter Zijlstra 2016-04-18 132 FETCH_FAMILY_TEST(, fetch_add, +=, onestwos);
28aa2bda2 Peter Zijlstra 2016-04-18 133 FETCH_FAMILY_TEST(, fetch_add, +=, -one);
28aa2bda2 Peter Zijlstra 2016-04-18 134 FETCH_FAMILY_TEST(, fetch_sub, -=, onestwos);
28aa2bda2 Peter Zijlstra 2016-04-18 135 FETCH_FAMILY_TEST(, fetch_sub, -=, -one);
28aa2bda2 Peter Zijlstra 2016-04-18 136
28aa2bda2 Peter Zijlstra 2016-04-18 137 FETCH_FAMILY_TEST(, fetch_or, |=, v1);
28aa2bda2 Peter Zijlstra 2016-04-18 138 FETCH_FAMILY_TEST(, fetch_and, &=, v1);
28aa2bda2 Peter Zijlstra 2016-04-18 139 FETCH_FAMILY_TEST(, fetch_andnot, &= ~, v1);
28aa2bda2 Peter Zijlstra 2016-04-18 140 FETCH_FAMILY_TEST(, fetch_xor, ^=, v1);
28aa2bda2 Peter Zijlstra 2016-04-18 141
978e5a369 Boqun Feng 2015-11-04 142 INC_RETURN_FAMILY_TEST(, v0);
978e5a369 Boqun Feng 2015-11-04 143 DEC_RETURN_FAMILY_TEST(, v0);
978e5a369 Boqun Feng 2015-11-04 144
978e5a369 Boqun Feng 2015-11-04 @145 XCHG_FAMILY_TEST(, v0, v1);
978e5a369 Boqun Feng 2015-11-04 146 CMPXCHG_FAMILY_TEST(, v0, v1, onestwos);
978e5a369 Boqun Feng 2015-11-04 147
:::::: The code at line 79 was first introduced by commit
:::::: 978e5a3692c3b674b4c7c412e96835fd996c2ff4 atomics: Add test for atomic operations with _relaxed variants
:::::: TO: Boqun Feng <boqun.feng@...il.com>
:::::: CC: Ingo Molnar <mingo@...nel.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (56229 bytes)
Powered by blists - more mailing lists