linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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?
@ 2022-08-11 11:11 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-08-11 11:11 UTC (permalink / raw)
  To: kbuild, Bard Liao
  Cc: lkp, kbuild-all, linux-kernel, Mark Brown, Pierre-Louis Bossart,
	Ranjani Sridharan

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-11 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 11:11 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? Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).