mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Subject: 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?
Date: Thu, 11 Aug 2022 14:11:20 +0300	[thread overview]
Message-ID: <202208110633.vYSBRTKf-lkp@intel.com> (raw)

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


                 reply	other threads:[~2022-08-11 11:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208110633.vYSBRTKf-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=broonie@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®