drivers/firewire/config-rom-parser-test.c:93:18: sparse: sparse: incorrect type in assignment (different base types)
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: af5f12805e5cefa4fe68d6127c7e1fb78cd5535c commit: 23e0d2e849eb84b8451c3f90e660222eea20f031 [3200/4370] firewire: core: add test to detect irm-is-1394-1995-only quirk in config ROM parser config: csky-randconfig-r113-20260905 (https://download.01.org/0day-ci/archive/20260906/[email protected]/config) compiler: csky-linux-gcc (GCC) 12.5.0 sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260906/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
drivers/firewire/core-device.c: note: in included file:
>> drivers/firewire/config-rom-parser-test.c:93:18: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/firewire/config-rom-parser-test.c:93:18: sparse: expected unsigned int [usertype]
drivers/firewire/config-rom-parser-test.c:93:18: sparse: got restricted __be32 [usertype]
vim +93 drivers/firewire/config-rom-parser-test.c
74
75 static int stub_run_regular_transaction(struct fw_card *card, int tcode, int destination_id,
76 int generation, int speed, unsigned long long offset,
77 void *payload, size_t length)
78 {
79 struct kunit *test = kunit_get_current_test();
80 const struct parser_test_case *param = test->param_value;
81
82 KUNIT_ASSERT_GE(test, offset, CSR_REGISTER_BASE | CSR_CONFIG_ROM);
83 KUNIT_ASSERT_LT(test, offset, CSR_REGISTER_BASE | CSR_CONFIG_ROM_END);
84 KUNIT_ASSERT_NOT_NULL(test, payload);
85 KUNIT_ASSERT_EQ(test, length, 4);
86
87 unsigned int index = (offset - (CSR_REGISTER_BASE | CSR_CONFIG_ROM)) / sizeof(u32);
88 u32 *quadlet = payload;
89
90 KUNIT_EXPECT_LE(test, speed, param->expected_speed);
91 KUNIT_EXPECT_LT(test, index, param->quadlet_length);
92
> 93 *quadlet = cpu_to_be32(param->quadlets[index]);
94
95 return RCODE_COMPLETE;
96 }
97 --
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Quoted 24 lines · kernel test robot
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
master
head:af5f12805e5cefa4fe68d6127c7e1fb78cd5535c
commit:23e0d2e849eb84b8451c3f90e660222eea20f031[3200/4370] firewire:
core: add test to detect irm-is-1394-1995-only quirk in config ROM parser
config: csky-randconfig-r113-20260905
(https://download.01.org/0day-ci/archive/20260906/[email protected]/config)
compiler: csky-linux-gcc (GCC) 12.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build):
(https://download.01.org/0day-ci/archive/20260906/[email protected]/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 <[email protected]>
| Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/sparse warnings: (new ones prefixed by >>)
drivers/firewire/core-device.c: note: in included file:Quoted 1 line
Quoted 1 line
drivers/firewire/config-rom-parser-test.c:93:18: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted__be32[usertype] @@
Quoted 8 lines
drivers/firewire/config-rom-parser-test.c:93:18: sparse:
expected unsigned int [usertype]
drivers/firewire/config-rom-parser-test.c:93:18: sparse: got
restricted__be32[usertype]vim +93
drivers/firewire/config-rom-parser-test.c
...88 u32 *quadlet = payload;
Indeed. This should be typed as __be32. I'll fix it later.
Thanks
Takashi Sakamoto