CC: [email protected] CC: [email protected] CC: [email protected] TO: Mark Brown <[email protected]>
tree: https://github.com/norov/linux bitmap-20210929 head: 9e1efbb647e456bb9ea583540b4d3eb63d150062 commit: c7a63e40ddb45e970a300580c1cd2db56924f228 [4365/4614] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git :::::: branch date: 5 weeks ago :::::: commit date: 6 weeks ago config: mips-randconfig-c004-20211001 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4) 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 # install mips cross compiling tool for clang build # apt-get install binutils-mips-linux-gnu # https://github.com/norov/linux/commit/c7a63e40ddb45e970a300580c1cd2db56924f228 git remote add norov https://github.com/norov/linux git fetch --no-tags norov bitmap-20210929 git checkout c7a63e40ddb45e970a300580c1cd2db56924f228 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ include/linux/kernel.h:495:61: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ sound/soc/codecs/wm_adsp.c:1418:24: note: Taking false branch struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ sound/soc/codecs/wm_adsp.c:1418:24: note: Loop condition is false. Exiting loop struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert' do { \ ^ sound/soc/codecs/wm_adsp.c:1423:2: note: 'ret' declared without an initial value int ret; ^~~~~~~ sound/soc/codecs/wm_adsp.c:1425:6: note: Assuming the condition is false if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1425:2: note: Taking false branch if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) ^ sound/soc/codecs/wm_adsp.c:1428:16: note: Calling 'cs_dsp_mem_region_name' region_name = cs_dsp_mem_region_name(cs_ctl->alg_region.type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:621:2: note: Control jumps to 'case 4:' at line 636 switch (type) { ^ sound/soc/codecs/wm_adsp.c:637:3: note: Returning pointer, which participates in a condition later return "ZM"; ^~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1428:16: note: Returning from 'cs_dsp_mem_region_name' region_name = cs_dsp_mem_region_name(cs_ctl->alg_region.type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1429:7: note: 'region_name' is non-null if (!region_name) { ^~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1429:2: note: Taking false branch if (!region_name) { ^ sound/soc/codecs/wm_adsp.c:1434:2: note: Control jumps to 'case 1:' at line 1436 switch (cs_dsp->fw_ver) { ^ sound/soc/codecs/wm_adsp.c:1439:3: note: Execution continues on line 1452 break; ^ sound/soc/codecs/wm_adsp.c:1452:6: note: Assuming field 'subname' is non-null if (cs_ctl->subname) { ^~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1452:2: note: Taking true branch if (cs_ctl->subname) { ^ sound/soc/codecs/wm_adsp.c:1453:45: note: The right operand of '-' is a garbage value int avail = SNDRV_CTL_ELEM_ID_NAME_MAXLEN - ret - 2; ^ ~~~ sound/soc/codecs/wm_adsp.c:1802:2: warning: Value stored to 'adsp1_sizes' is never read [clang-analyzer-deadcode.DeadStores] adsp1_sizes = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1802:2: note: Value stored to 'adsp1_sizes' is never read adsp1_sizes = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1873:2: warning: Value stored to 'adsp2_sizes' is never read [clang-analyzer-deadcode.DeadStores] adsp2_sizes = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1873:2: note: Value stored to 'adsp2_sizes' is never read adsp2_sizes = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1958:2: warning: Value stored to 'footer' is never read [clang-analyzer-deadcode.DeadStores] footer = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:1958:2: note: Value stored to 'footer' is never read footer = (void *)&firmware->data[pos]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> sound/soc/codecs/wm_adsp.c:4091:7: warning: Branch condition evaluates to a >> garbage value [clang-analyzer-core.uninitialized.Branch] if (coeff_v1.host_buf_ptr) ^ sound/soc/codecs/wm_adsp.c:3390:24: note: Left side of '&&' is false struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); ^ include/linux/kernel.h:495:61: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ sound/soc/codecs/wm_adsp.c:3390:24: note: Taking false branch struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ sound/soc/codecs/wm_adsp.c:3390:24: note: Loop condition is false. Exiting loop struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert' do { \ ^ sound/soc/codecs/wm_adsp.c:3392:6: note: Assuming field 'num_caps' is not equal to 0 if (wm_adsp_fw[dsp->fw].num_caps != 0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:3392:2: note: Taking true branch if (wm_adsp_fw[dsp->fw].num_caps != 0) ^ sound/soc/codecs/wm_adsp.c:3393:10: note: Calling 'wm_adsp_buffer_init' return wm_adsp_buffer_init(dsp); ^~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/wm_adsp.c:4148:2: note: Left side of '&&' is false list_for_each_entry(cs_ctl, &dsp->cs_dsp.ctl_list, list) { ^ include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry' for (pos = list_first_entry(head, typeof(*pos), member); \ ^ include/linux/list.h:522:2: note: expanded from macro 'list_first_entry' list_entry((ptr)->next, type, member) ^ include/linux/list.h:511:2: note: expanded from macro 'list_entry' container_of(ptr, type, member) ^ include/linux/kernel.h:495:61: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ sound/soc/codecs/wm_adsp.c:4148:2: note: Taking false branch list_for_each_entry(cs_ctl, &dsp->cs_dsp.ctl_list, list) { ^ include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry' for (pos = list_first_entry(head, typeof(*pos), member); \ ^ include/linux/list.h:522:2: note: expanded from macro 'list_first_entry' list_entry((ptr)->next, type, member) ^ include/linux/list.h:511:2: note: expanded from macro 'list_entry' container_of(ptr, type, member) ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ sound/soc/codecs/wm_adsp.c:4148:2: note: Loop condition is false. Exiting loop list_for_each_entry(cs_ctl, &dsp->cs_dsp.ctl_list, list) { ^ include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry' for (pos = list_first_entry(head, typeof(*pos), member); \ ^ include/linux/list.h:522:2: note: expanded from macro 'list_first_entry' list_entry((ptr)->next, type, member) ^ include/linux/list.h:511:2: note: expanded from macro 'list_entry' vim +4091 sound/soc/codecs/wm_adsp.c d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4077 0700bc2fb94c28 Simon Trimmer 2021-09-13 4078 static int wm_adsp_buffer_parse_coeff(struct cs_dsp_coeff_ctl *cs_ctl) d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4079 { 4f2d4eabf57718 Stuart Henderson 2019-02-22 4080 struct wm_adsp_host_buf_coeff_v1 coeff_v1; a792af69b08fd7 Charles Keepax 2019-02-22 4081 struct wm_adsp_compr_buf *buf; e146820215910d Simon Trimmer 2021-09-13 4082 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); 04ae08596737c4 Charles Keepax 2021-09-13 4083 unsigned int version; a792af69b08fd7 Charles Keepax 2019-02-22 4084 int ret, i; d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4085 d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4086 for (i = 0; i < 5; ++i) { 0700bc2fb94c28 Simon Trimmer 2021-09-13 4087 ret = cs_dsp_coeff_read_ctrl(cs_ctl, &coeff_v1, sizeof(coeff_v1)); d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4088 if (ret < 0) d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4089 return ret; d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4090 04ae08596737c4 Charles Keepax 2021-09-13 @4091 if (coeff_v1.host_buf_ptr) d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4092 break; d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4093 d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4094 usleep_range(1000, 2000); d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4095 } d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4096 04ae08596737c4 Charles Keepax 2021-09-13 4097 if (!coeff_v1.host_buf_ptr) { 0700bc2fb94c28 Simon Trimmer 2021-09-13 4098 adsp_err(dsp, "Failed to acquire host buffer\n"); d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4099 return -EIO; a792af69b08fd7 Charles Keepax 2019-02-22 4100 } d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4101 0700bc2fb94c28 Simon Trimmer 2021-09-13 4102 buf = wm_adsp_buffer_alloc(dsp); a792af69b08fd7 Charles Keepax 2019-02-22 4103 if (!buf) a792af69b08fd7 Charles Keepax 2019-02-22 4104 return -ENOMEM; a792af69b08fd7 Charles Keepax 2019-02-22 4105 0700bc2fb94c28 Simon Trimmer 2021-09-13 4106 buf->host_buf_mem_type = cs_ctl->alg_region.type; 04ae08596737c4 Charles Keepax 2021-09-13 4107 buf->host_buf_ptr = be32_to_cpu(coeff_v1.host_buf_ptr); a792af69b08fd7 Charles Keepax 2019-02-22 4108 a792af69b08fd7 Charles Keepax 2019-02-22 4109 ret = wm_adsp_buffer_populate(buf); a792af69b08fd7 Charles Keepax 2019-02-22 4110 if (ret < 0) a792af69b08fd7 Charles Keepax 2019-02-22 4111 return ret; a792af69b08fd7 Charles Keepax 2019-02-22 4112 4f2d4eabf57718 Stuart Henderson 2019-02-22 4113 /* 4f2d4eabf57718 Stuart Henderson 2019-02-22 4114 * v0 host_buffer coefficients didn't have versioning, so if the 4f2d4eabf57718 Stuart Henderson 2019-02-22 4115 * control is one word, assume version 0. 4f2d4eabf57718 Stuart Henderson 2019-02-22 4116 */ 0700bc2fb94c28 Simon Trimmer 2021-09-13 4117 if (cs_ctl->len == 4) { 0d3fba3e7a5669 Charles Keepax 2019-02-22 4118 compr_dbg(buf, "host_buf_ptr=%x\n", buf->host_buf_ptr); d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4119 return 0; d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4120 } d52ed4b0bc73c1 Richard Fitzgerald 2018-07-19 4121 a0b653e89a3afd Richard Fitzgerald 2020-12-30 4122 version = be32_to_cpu(coeff_v1.versions) & HOST_BUF_COEFF_COMPAT_VER_MASK; a0b653e89a3afd Richard Fitzgerald 2020-12-30 4123 version >>= HOST_BUF_COEFF_COMPAT_VER_SHIFT; 4f2d4eabf57718 Stuart Henderson 2019-02-22 4124 a0b653e89a3afd Richard Fitzgerald 2020-12-30 4125 if (version > HOST_BUF_COEFF_SUPPORTED_COMPAT_VER) { 0700bc2fb94c28 Simon Trimmer 2021-09-13 4126 adsp_err(dsp, 4f2d4eabf57718 Stuart Henderson 2019-02-22 4127 "Host buffer coeff ver %u > supported version %u\n", a0b653e89a3afd Richard Fitzgerald 2020-12-30 4128 version, HOST_BUF_COEFF_SUPPORTED_COMPAT_VER); 4f2d4eabf57718 Stuart Henderson 2019-02-22 4129 return -EINVAL; 4f2d4eabf57718 Stuart Henderson 2019-02-22 4130 } 4f2d4eabf57718 Stuart Henderson 2019-02-22 4131 5beb8eeade2c03 Simon Trimmer 2021-09-13 4132 cs_dsp_remove_padding((u32 *)&coeff_v1.name, ARRAY_SIZE(coeff_v1.name)); 4f2d4eabf57718 Stuart Henderson 2019-02-22 4133 0700bc2fb94c28 Simon Trimmer 2021-09-13 4134 buf->name = kasprintf(GFP_KERNEL, "%s-dsp-%s", dsp->part, 4f2d4eabf57718 Stuart Henderson 2019-02-22 4135 (char *)&coeff_v1.name); 4f2d4eabf57718 Stuart Henderson 2019-02-22 4136 0d3fba3e7a5669 Charles Keepax 2019-02-22 4137 compr_dbg(buf, "host_buf_ptr=%x coeff version %u\n", a0b653e89a3afd Richard Fitzgerald 2020-12-30 4138 buf->host_buf_ptr, version); 4f2d4eabf57718 Stuart Henderson 2019-02-22 4139 a0b653e89a3afd Richard Fitzgerald 2020-12-30 4140 return version; 4f2d4eabf57718 Stuart Henderson 2019-02-22 4141 } 4f2d4eabf57718 Stuart Henderson 2019-02-22 4142 :::::: The code at line 4091 was first introduced by commit :::::: 04ae08596737c4d3872dfb6e617c918d9ecf073e ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed buffers :::::: TO: Charles Keepax <[email protected]> :::::: CC: Mark Brown <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
