drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: sparse: incompatible types for operation (==):
From: kernel test robot
Date: Wed Jul 08 2026 - 18:16:01 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
commit: ce5971773651ad5c7e26aea29d72ea8887428774 drm/xe: Introduce IF_ARGS macro utility
date: 7 months ago
config: powerpc-randconfig-r131-20260708 (https://download.01.org/0day-ci/archive/20260709/202607090601.odxc3iTj-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260709/202607090601.odxc3iTj-lkp@xxxxxxxxx/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
| Fixes: ce5971773651 ("drm/xe: Introduce IF_ARGS macro utility")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607090601.odxc3iTj-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/xe/tests/xe_args_test.c:89:9: sparse: sparse: Expected ) after typeof
drivers/gpu/drm/xe/tests/xe_args_test.c:89:9: sparse: sparse: got Q
drivers/gpu/drm/xe/tests/xe_args_test.c:90:9: sparse: sparse: Expected ) after typeof
drivers/gpu/drm/xe/tests/xe_args_test.c:90:9: sparse: sparse: got Q
drivers/gpu/drm/xe/tests/xe_args_test.c:225:9: sparse: sparse: Expected ) in expression
drivers/gpu/drm/xe/tests/xe_args_test.c:225:9: sparse: sparse: got false
drivers/gpu/drm/xe/tests/xe_args_test.c:226:9: sparse: sparse: Expected ) in expression
drivers/gpu/drm/xe/tests/xe_args_test.c:226:9: sparse: sparse: got false
drivers/gpu/drm/xe/tests/xe_args_test.c:228:9: sparse: sparse: Expected ) in expression
drivers/gpu/drm/xe/tests/xe_args_test.c:228:9: sparse: sparse: got no_args
drivers/gpu/drm/xe/tests/xe_args_test.c:229:9: sparse: sparse: Expected ) in expression
drivers/gpu/drm/xe/tests/xe_args_test.c:229:9: sparse: sparse: got no_args
drivers/gpu/drm/xe/tests/xe_args_test.c:89:9: sparse: sparse: undefined identifier '__left'
drivers/gpu/drm/xe/tests/xe_args_test.c:89:9: sparse: sparse: undefined identifier '__left'
drivers/gpu/drm/xe/tests/xe_args_test.c:90:9: sparse: sparse: undefined identifier '__left'
drivers/gpu/drm/xe/tests/xe_args_test.c:90:9: sparse: sparse: undefined identifier '__left'
drivers/gpu/drm/xe/tests/xe_args_test.c:225:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:226:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:228:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:229:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: sparse: undefined identifier '__VA_OPT__'
>> drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:234:9: sparse: int const __right
drivers/gpu/drm/xe/tests/xe_args_test.c:235:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:235:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:235:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:235:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:235:9: sparse: int const __right
drivers/gpu/drm/xe/tests/xe_args_test.c:236:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:236:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:236:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:236:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:236:9: sparse: int const __right
drivers/gpu/drm/xe/tests/xe_args_test.c:237:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:237:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:237:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:237:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:237:9: sparse: int const __right
drivers/gpu/drm/xe/tests/xe_args_test.c:239:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:239:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:239:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:239:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:239:9: sparse: int const __right
drivers/gpu/drm/xe/tests/xe_args_test.c:242:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:242:9: sparse: sparse: undefined identifier '__VA_OPT__'
drivers/gpu/drm/xe/tests/xe_args_test.c:242:9: sparse: sparse: incompatible types for operation (==):
drivers/gpu/drm/xe/tests/xe_args_test.c:242:9: sparse: bad type const __left
drivers/gpu/drm/xe/tests/xe_args_test.c:242:9: sparse: int const __right
vim +234 drivers/gpu/drm/xe/tests/xe_args_test.c
218
219 static void if_args_test(struct kunit *test)
220 {
221 bool with_args = true;
222 bool no_args = false;
223 enum { X = 100 };
224
225 KUNIT_EXPECT_TRUE(test, IF_ARGS(true, false, FOO_ARGS));
226 KUNIT_EXPECT_FALSE(test, IF_ARGS(true, false, NO_ARGS));
227
228 KUNIT_EXPECT_TRUE(test, CONCATENATE(IF_ARGS(with, no, FOO_ARGS), _args));
229 KUNIT_EXPECT_FALSE(test, CONCATENATE(IF_ARGS(with, no, NO_ARGS), _args));
230
231 KUNIT_EXPECT_STREQ(test, __stringify(IF_ARGS(yes, no, FOO_ARGS)), "yes");
232 KUNIT_EXPECT_STREQ(test, __stringify(IF_ARGS(yes, no, NO_ARGS)), "no");
233
> 234 KUNIT_EXPECT_EQ(test, IF_ARGS(CALL_ARGS(COUNT_ARGS, FOO_ARGS), -1, FOO_ARGS), 4);
235 KUNIT_EXPECT_EQ(test, IF_ARGS(CALL_ARGS(COUNT_ARGS, FOO_ARGS), -1, NO_ARGS), -1);
236 KUNIT_EXPECT_EQ(test, IF_ARGS(CALL_ARGS(COUNT_ARGS, NO_ARGS), -1, FOO_ARGS), 0);
237 KUNIT_EXPECT_EQ(test, IF_ARGS(CALL_ARGS(COUNT_ARGS, NO_ARGS), -1, NO_ARGS), -1);
238
239 KUNIT_EXPECT_EQ(test,
240 CALL_ARGS(FIRST_ARG,
241 CALL_ARGS(CONCATENATE, IF_ARGS(FOO, MAX, FOO_ARGS), _ARGS)), X);
242 KUNIT_EXPECT_EQ(test,
243 CALL_ARGS(FIRST_ARG,
244 CALL_ARGS(CONCATENATE, IF_ARGS(FOO, MAX, NO_ARGS), _ARGS)), -1);
245 KUNIT_EXPECT_EQ(test,
246 CALL_ARGS(COUNT_ARGS,
247 CALL_ARGS(CONCATENATE, IF_ARGS(FOO, MAX, FOO_ARGS), _ARGS)), 4);
248 KUNIT_EXPECT_EQ(test,
249 CALL_ARGS(COUNT_ARGS,
250 CALL_ARGS(CONCATENATE, IF_ARGS(FOO, MAX, NO_ARGS), _ARGS)), 12);
251 }
252
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki