CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com TO: "Pierre-Louis Bossart" CC: nanli2x CC: Rander Wang CC: Bard Liao tree: https://github.com/intel/linux-intel-lts.git 5.10/yocto head: bc85b67a97aa2ce0c02aa7364781774f1766d952 commit: 99d62cba396dc2c733c62b8ffd1dde7ddc6701d3 [6/8] soundwire: bus: use no_pm IO routines for all interrupt handling :::::: branch date: 4 days ago :::::: commit date: 4 days ago config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220417/202204170827.Ytjc7trW-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 64c045e25b8471bbb572bd29159c294a82a86a25) 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/intel/linux-intel-lts/commit/99d62cba396dc2c733c62b8ffd1dde7ddc6701d3 git remote add intel-lts https://github.com/intel/linux-intel-lts.git git fetch --no-tags intel-lts 5.10/yocto git checkout 99d62cba396dc2c733c62b8ffd1dde7ddc6701d3 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) 10 warnings generated. Suppressed 10 warnings (10 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 12 warnings generated. fs/cifs/connect.c:4909:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcpy(bcc_ptr, tree); ^~~~~~ fs/cifs/connect.c:4909:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 strcpy(bcc_ptr, tree); ^~~~~~ fs/cifs/connect.c:4912:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcpy(bcc_ptr, "?????"); ^~~~~~ fs/cifs/connect.c:4912:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 strcpy(bcc_ptr, "?????"); ^~~~~~ Suppressed 10 warnings (10 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. sound/soc/codecs/cs42l56.c:1246:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l56.c:1246:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. sound/soc/codecs/cs42l73.c:1329:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_AB, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l73.c:1329:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_AB, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l73.c:1332:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_CD, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l73.c:1332:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_CD, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l73.c:1335:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_E, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l73.c:1335:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l73->regmap, CS42L73_DEVID_E, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 10 warnings generated. sound/soc/codecs/max98088.c:1441:8: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores] best = 0; ^ ~ sound/soc/codecs/max98088.c:1441:8: note: Value stored to 'best' is never read best = 0; ^ ~ sound/soc/codecs/max98088.c:1446:24: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores] best = i; ^ ~ sound/soc/codecs/max98088.c:1446:24: note: Value stored to 'best' is never read best = i; ^ ~ sound/soc/codecs/max98088.c:1488:8: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores] best = 0; ^ ~ sound/soc/codecs/max98088.c:1488:8: note: Value stored to 'best' is never read best = 0; ^ ~ sound/soc/codecs/max98088.c:1493:24: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores] best = i; ^ ~ sound/soc/codecs/max98088.c:1493:24: note: Value stored to 'best' is never read best = i; ^ ~ Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. >> drivers/soundwire/bus.c:1427:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = sdw_write(slave, addr, clear); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/soundwire/bus.c:1427:3: note: Value stored to 'ret' is never read ret = sdw_write(slave, addr, clear); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. fs/ext2/dir.c:449:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores] err = ext2_commit_chunk(page, pos, len); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/ext2/dir.c:449:2: note: Value stored to 'err' is never read err = ext2_commit_chunk(page, pos, len); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. sound/soc/codecs/tlv320aic32x4-clk.c:39:8: warning: Excessive padding in 'struct aic32x4_clkdesc' (8 padding bytes, where 0 is optimal). Optimal fields order: name, parent_names, ops, num_parents, reg, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding] struct aic32x4_clkdesc { ~~~~~~~^~~~~~~~~~~~~~~~~ sound/soc/codecs/tlv320aic32x4-clk.c:39:8: note: Excessive padding in 'struct aic32x4_clkdesc' (8 padding bytes, where 0 is optimal). Optimal fields order: name, parent_names, ops, num_parents, reg, consider reordering the fields or adding explicit padding members struct aic32x4_clkdesc { ~~~~~~~^~~~~~~~~~~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (5 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. Suppressed 5 warnings (4 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 8 warnings generated. sound/soc/codecs/wm8731.c:106:3: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores] best = 0; ^ ~ sound/soc/codecs/wm8731.c:106:3: note: Value stored to 'best' is never read best = 0; ^ ~ Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). vim +/ret +1427 drivers/soundwire/bus.c b0a9c37b0178bf Vinod Koul 2017-12-14 1383 b0a9c37b0178bf Vinod Koul 2017-12-14 1384 static int sdw_handle_port_interrupt(struct sdw_slave *slave, b0a9c37b0178bf Vinod Koul 2017-12-14 1385 int port, u8 *slave_status) b0a9c37b0178bf Vinod Koul 2017-12-14 1386 { b0a9c37b0178bf Vinod Koul 2017-12-14 1387 u8 clear = 0, impl_int_mask; b0a9c37b0178bf Vinod Koul 2017-12-14 1388 int status, status2, ret, count = 0; b0a9c37b0178bf Vinod Koul 2017-12-14 1389 u32 addr; b0a9c37b0178bf Vinod Koul 2017-12-14 1390 b0a9c37b0178bf Vinod Koul 2017-12-14 1391 if (port == 0) b0a9c37b0178bf Vinod Koul 2017-12-14 1392 return sdw_handle_dp0_interrupt(slave, slave_status); b0a9c37b0178bf Vinod Koul 2017-12-14 1393 b0a9c37b0178bf Vinod Koul 2017-12-14 1394 addr = SDW_DPN_INT(port); 99d62cba396dc2 Pierre-Louis Bossart 2021-01-22 1395 status = sdw_read_no_pm(slave, addr); b0a9c37b0178bf Vinod Koul 2017-12-14 1396 if (status < 0) { 60d3d1770d7321 Pierre-Louis Bossart 2021-01-22 1397 dev_err(&slave->dev, 17ed5bef49f42e Pierre-Louis Bossart 2019-05-01 1398 "SDW_DPN_INT read failed:%d\n", status); b0a9c37b0178bf Vinod Koul 2017-12-14 1399 b0a9c37b0178bf Vinod Koul 2017-12-14 1400 return status; b0a9c37b0178bf Vinod Koul 2017-12-14 1401 } b0a9c37b0178bf Vinod Koul 2017-12-14 1402 b0a9c37b0178bf Vinod Koul 2017-12-14 1403 do { b0a9c37b0178bf Vinod Koul 2017-12-14 1404 if (status & SDW_DPN_INT_TEST_FAIL) { 17ed5bef49f42e Pierre-Louis Bossart 2019-05-01 1405 dev_err(&slave->dev, "Test fail for port:%d\n", port); b0a9c37b0178bf Vinod Koul 2017-12-14 1406 clear |= SDW_DPN_INT_TEST_FAIL; b0a9c37b0178bf Vinod Koul 2017-12-14 1407 } b0a9c37b0178bf Vinod Koul 2017-12-14 1408 b0a9c37b0178bf Vinod Koul 2017-12-14 1409 /* b0a9c37b0178bf Vinod Koul 2017-12-14 1410 * Assumption: PORT_READY interrupt will be received only b0a9c37b0178bf Vinod Koul 2017-12-14 1411 * for ports implementing CP_SM. b0a9c37b0178bf Vinod Koul 2017-12-14 1412 */ b0a9c37b0178bf Vinod Koul 2017-12-14 1413 if (status & SDW_DPN_INT_PORT_READY) { b0a9c37b0178bf Vinod Koul 2017-12-14 1414 complete(&slave->port_ready[port]); b0a9c37b0178bf Vinod Koul 2017-12-14 1415 clear |= SDW_DPN_INT_PORT_READY; b0a9c37b0178bf Vinod Koul 2017-12-14 1416 } b0a9c37b0178bf Vinod Koul 2017-12-14 1417 b0a9c37b0178bf Vinod Koul 2017-12-14 1418 impl_int_mask = SDW_DPN_INT_IMPDEF1 | b0a9c37b0178bf Vinod Koul 2017-12-14 1419 SDW_DPN_INT_IMPDEF2 | SDW_DPN_INT_IMPDEF3; b0a9c37b0178bf Vinod Koul 2017-12-14 1420 b0a9c37b0178bf Vinod Koul 2017-12-14 1421 if (status & impl_int_mask) { b0a9c37b0178bf Vinod Koul 2017-12-14 1422 clear |= impl_int_mask; b0a9c37b0178bf Vinod Koul 2017-12-14 1423 *slave_status = clear; b0a9c37b0178bf Vinod Koul 2017-12-14 1424 } b0a9c37b0178bf Vinod Koul 2017-12-14 1425 b0a9c37b0178bf Vinod Koul 2017-12-14 1426 /* clear the interrupt */ b0a9c37b0178bf Vinod Koul 2017-12-14 @1427 ret = sdw_write(slave, addr, clear); 99d62cba396dc2 Pierre-Louis Bossart 2021-01-22 1428 /* clear the interrupt but don't touch reserved fields */ 99d62cba396dc2 Pierre-Louis Bossart 2021-01-22 1429 ret = sdw_write_no_pm(slave, addr, clear); b0a9c37b0178bf Vinod Koul 2017-12-14 1430 if (ret < 0) { 60d3d1770d7321 Pierre-Louis Bossart 2021-01-22 1431 dev_err(&slave->dev, 17ed5bef49f42e Pierre-Louis Bossart 2019-05-01 1432 "SDW_DPN_INT write failed:%d\n", ret); b0a9c37b0178bf Vinod Koul 2017-12-14 1433 return ret; b0a9c37b0178bf Vinod Koul 2017-12-14 1434 } b0a9c37b0178bf Vinod Koul 2017-12-14 1435 b0a9c37b0178bf Vinod Koul 2017-12-14 1436 /* Read DPN interrupt again */ 99d62cba396dc2 Pierre-Louis Bossart 2021-01-22 1437 status2 = sdw_read_no_pm(slave, addr); 80cd8f0175d03f Wei Yongjun 2018-01-08 1438 if (status2 < 0) { 60d3d1770d7321 Pierre-Louis Bossart 2021-01-22 1439 dev_err(&slave->dev, 17ed5bef49f42e Pierre-Louis Bossart 2019-05-01 1440 "SDW_DPN_INT read failed:%d\n", status2); 80cd8f0175d03f Wei Yongjun 2018-01-08 1441 return status2; b0a9c37b0178bf Vinod Koul 2017-12-14 1442 } b0a9c37b0178bf Vinod Koul 2017-12-14 1443 status &= status2; b0a9c37b0178bf Vinod Koul 2017-12-14 1444 b0a9c37b0178bf Vinod Koul 2017-12-14 1445 count++; b0a9c37b0178bf Vinod Koul 2017-12-14 1446 b0a9c37b0178bf Vinod Koul 2017-12-14 1447 /* we can get alerts while processing so keep retrying */ b0a9c37b0178bf Vinod Koul 2017-12-14 1448 } while (status != 0 && count < SDW_READ_INTR_CLEAR_RETRY); b0a9c37b0178bf Vinod Koul 2017-12-14 1449 b0a9c37b0178bf Vinod Koul 2017-12-14 1450 if (count == SDW_READ_INTR_CLEAR_RETRY) 60d3d1770d7321 Pierre-Louis Bossart 2021-01-22 1451 dev_warn(&slave->dev, "Reached MAX_RETRY on port read"); b0a9c37b0178bf Vinod Koul 2017-12-14 1452 b0a9c37b0178bf Vinod Koul 2017-12-14 1453 return ret; b0a9c37b0178bf Vinod Koul 2017-12-14 1454 } b0a9c37b0178bf Vinod Koul 2017-12-14 1455 :::::: The code at line 1427 was first introduced by commit :::::: b0a9c37b0178bf397393952e98789b0d4dc7fd6c soundwire: Add slave status handling :::::: TO: Vinod Koul :::::: CC: Greg Kroah-Hartman -- 0-DAY CI Kernel Test Service https://01.org/lkp