lkml.org 
[lkml]   [2022]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsound/soc/sof/ipc4-topology.c:1143 sof_ipc4_prepare_copier_module() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing?
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f41445645ab5d172e6090d00c332c335d8dba337
commit: a150345aa758492e05d2934f318ce7c2566b1cfe ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support
config: i386-randconfig-m021-20220808 (https://download.01.org/0day-ci/archive/20220811/202208110633.vYSBRTKf-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
sound/soc/sof/ipc4-topology.c:1143 sof_ipc4_prepare_copier_module() error: Calling ida_alloc_max() with a 'max' argument which is a power of 2. -1 missing?

vim +/max +1143 sound/soc/sof/ipc4-topology.c

a150345aa75849 Bard Liao 2022-06-14 1140 if (blob->alh_cfg.count > 1) {
a150345aa75849 Bard Liao 2022-06-14 1141 int group_id;
a150345aa75849 Bard Liao 2022-06-14 1142
a150345aa75849 Bard Liao 2022-06-14 @1143 group_id = ida_alloc_max(&alh_group_ida, ALH_MULTI_GTW_COUNT,

I didn't write this Smatch check. I guess the theory is that normally
we would want group_id to be 0-7 instead of 0-8. But when I look at
the surrounding code I'm sort of curious why it's not 0-255?

a150345aa75849 Bard Liao 2022-06-14 1144 GFP_KERNEL);
a150345aa75849 Bard Liao 2022-06-14 1145
a150345aa75849 Bard Liao 2022-06-14 1146 if (group_id < 0)
a150345aa75849 Bard Liao 2022-06-14 1147 return group_id;
a150345aa75849 Bard Liao 2022-06-14 1148
a150345aa75849 Bard Liao 2022-06-14 1149 /* add multi-gateway base */
a150345aa75849 Bard Liao 2022-06-14 1150 group_id += ALH_MULTI_GTW_BASE;
a150345aa75849 Bard Liao 2022-06-14 1151 copier_data->gtw_cfg.node_id &= ~SOF_IPC4_NODE_INDEX_MASK;
a150345aa75849 Bard Liao 2022-06-14 1152 copier_data->gtw_cfg.node_id |= SOF_IPC4_NODE_INDEX(group_id);
a150345aa75849 Bard Liao 2022-06-14 1153 }
a45a4d4390b7a5 Bard Liao 2022-06-08 1154 }
a45a4d4390b7a5 Bard Liao 2022-06-08 1155 }
a45a4d4390b7a5 Bard Liao 2022-06-08 1156 }

--
0-DAY CI Kernel Test Service
https://01.org/lkp

\
 
 \ /
  Last update: 2022-08-11 13:18    [W:0.049 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site