From: kernel test robot <lkp@intel.com>
To: Dishank Jogi <jogidishank503@gmail.com>, elver@google.com
Cc: oe-kbuild-all@lists.linux.dev, dvyukov@google.com,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
rathod.darshan.0896@gmail.com,
Dishank Jogi <jogidishank503@gmail.com>
Subject: Re: [PATCH] kcsan: clean up redundant empty macro arguments in atomic ops.
Date: Tue, 29 Jul 2025 04:31:52 +0800 [thread overview]
Message-ID: <202507290412.DayPyZpH-lkp@intel.com> (raw)
In-Reply-To: <20250728104327.48469-1-jogidishank503@gmail.com>
Hi Dishank,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.16 next-20250728]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dishank-Jogi/kcsan-clean-up-redundant-empty-macro-arguments-in-atomic-ops/20250728-184659
base: linus/master
patch link: https://lore.kernel.org/r/20250728104327.48469-1-jogidishank503%40gmail.com
patch subject: [PATCH] kcsan: clean up redundant empty macro arguments in atomic ops.
config: x86_64-buildonly-randconfig-002-20250729 (https://download.01.org/0day-ci/archive/20250729/202507290412.DayPyZpH-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250729/202507290412.DayPyZpH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507290412.DayPyZpH-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
>> kernel/kcsan/core.c:1260:9: warning: data definition has no type or storage class
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1260:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1261:9: warning: data definition has no type or storage class
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1261:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1262:9: warning: data definition has no type or storage class
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1262:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1263:9: warning: data definition has no type or storage class
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1263:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1264:9: warning: data definition has no type or storage class
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1264:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1265:9: warning: data definition has no type or storage class
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1265:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1270:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1270 | DEFINE_TSAN_ATOMIC_OPS(8);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
>> kernel/kcsan/core.c:1260:9: warning: data definition has no type or storage class
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1260:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1261:9: warning: data definition has no type or storage class
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1261:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1262:9: warning: data definition has no type or storage class
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1262:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1263:9: warning: data definition has no type or storage class
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1263:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1264:9: warning: data definition has no type or storage class
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1264:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1265:9: warning: data definition has no type or storage class
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1265:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1271:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1271 | DEFINE_TSAN_ATOMIC_OPS(16);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
>> kernel/kcsan/core.c:1260:9: warning: data definition has no type or storage class
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1260:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1261:9: warning: data definition has no type or storage class
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1261:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1262:9: warning: data definition has no type or storage class
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1262:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1263:9: warning: data definition has no type or storage class
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1263:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1264:9: warning: data definition has no type or storage class
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1264:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1265:9: warning: data definition has no type or storage class
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1265:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1272:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1272 | DEFINE_TSAN_ATOMIC_OPS(32);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
>> kernel/kcsan/core.c:1260:9: warning: data definition has no type or storage class
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1260:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1260 | DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1261:9: warning: data definition has no type or storage class
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1261:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1261 | DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1262:9: warning: data definition has no type or storage class
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1262:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1262 | DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1263:9: warning: data definition has no type or storage class
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1263:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1263 | DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1264:9: warning: data definition has no type or storage class
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1264:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1264 | DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: error: macro "DEFINE_TSAN_ATOMIC_RMW" requires 3 arguments, but only 2 given
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1193: note: macro "DEFINE_TSAN_ATOMIC_RMW" defined here
1193 | #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
|
kernel/kcsan/core.c:1265:9: warning: data definition has no type or storage class
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1265:9: error: type defaults to 'int' in declaration of 'DEFINE_TSAN_ATOMIC_RMW' [-Werror=implicit-int]
1265 | DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/kcsan/core.c:1274:1: note: in expansion of macro 'DEFINE_TSAN_ATOMIC_OPS'
1274 | DEFINE_TSAN_ATOMIC_OPS(64);
vim +1260 kernel/kcsan/core.c
1169
1170 #define DEFINE_TSAN_ATOMIC_LOAD_STORE(bits) \
1171 u##bits __tsan_atomic##bits##_load(const u##bits *ptr, int memorder); \
1172 u##bits __tsan_atomic##bits##_load(const u##bits *ptr, int memorder) \
1173 { \
1174 kcsan_atomic_builtin_memorder(memorder); \
1175 if (!IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) { \
1176 check_access(ptr, bits / BITS_PER_BYTE, KCSAN_ACCESS_ATOMIC, _RET_IP_); \
1177 } \
1178 return __atomic_load_n(ptr, memorder); \
1179 } \
1180 EXPORT_SYMBOL(__tsan_atomic##bits##_load); \
1181 void __tsan_atomic##bits##_store(u##bits *ptr, u##bits v, int memorder); \
1182 void __tsan_atomic##bits##_store(u##bits *ptr, u##bits v, int memorder) \
1183 { \
1184 kcsan_atomic_builtin_memorder(memorder); \
1185 if (!IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) { \
1186 check_access(ptr, bits / BITS_PER_BYTE, \
1187 KCSAN_ACCESS_WRITE | KCSAN_ACCESS_ATOMIC, _RET_IP_); \
1188 } \
1189 __atomic_store_n(ptr, v, memorder); \
1190 } \
1191 EXPORT_SYMBOL(__tsan_atomic##bits##_store)
1192
1193 #define DEFINE_TSAN_ATOMIC_RMW(op, bits, suffix) \
1194 u##bits __tsan_atomic##bits##_##op(u##bits *ptr, u##bits v, int memorder); \
1195 u##bits __tsan_atomic##bits##_##op(u##bits *ptr, u##bits v, int memorder) \
1196 { \
1197 kcsan_atomic_builtin_memorder(memorder); \
1198 if (!IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) { \
1199 check_access(ptr, bits / BITS_PER_BYTE, \
1200 KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE | \
1201 KCSAN_ACCESS_ATOMIC, _RET_IP_); \
1202 } \
1203 return __atomic_##op##suffix(ptr, v, memorder); \
1204 } \
1205 EXPORT_SYMBOL(__tsan_atomic##bits##_##op)
1206
1207 /*
1208 * Note: CAS operations are always classified as write, even in case they
1209 * fail. We cannot perform check_access() after a write, as it might lead to
1210 * false positives, in cases such as:
1211 *
1212 * T0: __atomic_compare_exchange_n(&p->flag, &old, 1, ...)
1213 *
1214 * T1: if (__atomic_load_n(&p->flag, ...)) {
1215 * modify *p;
1216 * p->flag = 0;
1217 * }
1218 *
1219 * The only downside is that, if there are 3 threads, with one CAS that
1220 * succeeds, another CAS that fails, and an unmarked racing operation, we may
1221 * point at the wrong CAS as the source of the race. However, if we assume that
1222 * all CAS can succeed in some other execution, the data race is still valid.
1223 */
1224 #define DEFINE_TSAN_ATOMIC_CMPXCHG(bits, strength, weak) \
1225 int __tsan_atomic##bits##_compare_exchange_##strength(u##bits *ptr, u##bits *exp, \
1226 u##bits val, int mo, int fail_mo); \
1227 int __tsan_atomic##bits##_compare_exchange_##strength(u##bits *ptr, u##bits *exp, \
1228 u##bits val, int mo, int fail_mo) \
1229 { \
1230 kcsan_atomic_builtin_memorder(mo); \
1231 if (!IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) { \
1232 check_access(ptr, bits / BITS_PER_BYTE, \
1233 KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE | \
1234 KCSAN_ACCESS_ATOMIC, _RET_IP_); \
1235 } \
1236 return __atomic_compare_exchange_n(ptr, exp, val, weak, mo, fail_mo); \
1237 } \
1238 EXPORT_SYMBOL(__tsan_atomic##bits##_compare_exchange_##strength)
1239
1240 #define DEFINE_TSAN_ATOMIC_CMPXCHG_VAL(bits) \
1241 u##bits __tsan_atomic##bits##_compare_exchange_val(u##bits *ptr, u##bits exp, u##bits val, \
1242 int mo, int fail_mo); \
1243 u##bits __tsan_atomic##bits##_compare_exchange_val(u##bits *ptr, u##bits exp, u##bits val, \
1244 int mo, int fail_mo) \
1245 { \
1246 kcsan_atomic_builtin_memorder(mo); \
1247 if (!IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)) { \
1248 check_access(ptr, bits / BITS_PER_BYTE, \
1249 KCSAN_ACCESS_COMPOUND | KCSAN_ACCESS_WRITE | \
1250 KCSAN_ACCESS_ATOMIC, _RET_IP_); \
1251 } \
1252 __atomic_compare_exchange_n(ptr, &exp, val, 0, mo, fail_mo); \
1253 return exp; \
1254 } \
1255 EXPORT_SYMBOL(__tsan_atomic##bits##_compare_exchange_val)
1256
1257 #define DEFINE_TSAN_ATOMIC_OPS(bits) \
1258 DEFINE_TSAN_ATOMIC_LOAD_STORE(bits); \
1259 DEFINE_TSAN_ATOMIC_RMW(exchange, bits, _n); \
> 1260 DEFINE_TSAN_ATOMIC_RMW(fetch_add, bits); \
1261 DEFINE_TSAN_ATOMIC_RMW(fetch_sub, bits); \
1262 DEFINE_TSAN_ATOMIC_RMW(fetch_and, bits); \
1263 DEFINE_TSAN_ATOMIC_RMW(fetch_or, bits); \
1264 DEFINE_TSAN_ATOMIC_RMW(fetch_xor, bits); \
1265 DEFINE_TSAN_ATOMIC_RMW(fetch_nand, bits); \
1266 DEFINE_TSAN_ATOMIC_CMPXCHG(bits, strong, 0); \
1267 DEFINE_TSAN_ATOMIC_CMPXCHG(bits, weak, 1); \
1268 DEFINE_TSAN_ATOMIC_CMPXCHG_VAL(bits)
1269
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-07-28 20:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 10:43 [PATCH] kcsan: clean up redundant empty macro arguments in atomic ops Dishank Jogi
2025-07-28 10:55 ` Marco Elver
[not found] ` <CADorM--0n1zeT8jxT3LtjmqrP5Cp1g-hFS=oz_12SptjZwRWtw@mail.gmail.com>
2025-07-28 11:51 ` Marco Elver
2025-07-28 20:31 ` kernel test robot [this message]
2025-07-28 21:44 ` kernel test robot
2025-07-29 5:17 ` Jogi Dishank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202507290412.DayPyZpH-lkp@intel.com \
--to=lkp@intel.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=jogidishank503@gmail.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rathod.darshan.0896@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.