* sound/soc/codecs/tas2781-i2c.c:255:26-27: WARNING opportunity for min()
@ 2023-07-16 16:41 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-07-16 16:41 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Shenghao Ding <13916275206@139.com>
CC: Mark Brown <broonie@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 831fe284d8275987596b7d640518dddba5735f61
commit: ef3bcde75d06d65f78ba38a30d5a87fb83a5cdae ASoC: tas2781: Add tas2781 driver
date: 4 weeks ago
:::::: branch date: 25 hours ago
:::::: commit date: 4 weeks ago
config: powerpc-randconfig-r061-20230716 (https://download.01.org/0day-ci/archive/20230717/202307170049.Itoc4w21-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230717/202307170049.Itoc4w21-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202307170049.Itoc4w21-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> sound/soc/codecs/tas2781-i2c.c:255:26-27: WARNING opportunity for min()
sound/soc/codecs/tas2781-i2c.c:365:14-15: WARNING opportunity for min()
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* sound/soc/codecs/tas2781-i2c.c:255:26-27: WARNING opportunity for min()
@ 2024-01-02 11:53 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-01-02 11:53 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Shenghao Ding <13916275206@139.com>
CC: Mark Brown <broonie@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 610a9b8f49fbcf1100716370d3b5f6f884a2835a
commit: ef3bcde75d06d65f78ba38a30d5a87fb83a5cdae ASoC: tas2781: Add tas2781 driver
date: 7 months ago
:::::: branch date: 2 days ago
:::::: commit date: 7 months ago
config: sparc64-randconfig-r051-20240102 (https://download.01.org/0day-ci/archive/20240102/202401021929.eW58tuKw-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202401021929.eW58tuKw-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> sound/soc/codecs/tas2781-i2c.c:255:26-27: WARNING opportunity for min()
sound/soc/codecs/tas2781-i2c.c:365:14-15: WARNING opportunity for min()
vim +255 sound/soc/codecs/tas2781-i2c.c
ef3bcde75d06d6 Shenghao Ding 2023-06-18 223
ef3bcde75d06d6 Shenghao Ding 2023-06-18 224 static int tasdevice_create_control(struct tasdevice_priv *tas_priv)
ef3bcde75d06d6 Shenghao Ding 2023-06-18 225 {
ef3bcde75d06d6 Shenghao Ding 2023-06-18 226 struct snd_kcontrol_new *prof_ctrls;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 227 int nr_controls = 1;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 228 int mix_index = 0;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 229 int ret;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 230 char *name;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 231
ef3bcde75d06d6 Shenghao Ding 2023-06-18 232 prof_ctrls = devm_kcalloc(tas_priv->dev, nr_controls,
ef3bcde75d06d6 Shenghao Ding 2023-06-18 233 sizeof(prof_ctrls[0]), GFP_KERNEL);
ef3bcde75d06d6 Shenghao Ding 2023-06-18 234 if (!prof_ctrls) {
ef3bcde75d06d6 Shenghao Ding 2023-06-18 235 ret = -ENOMEM;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 236 goto out;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 237 }
ef3bcde75d06d6 Shenghao Ding 2023-06-18 238
ef3bcde75d06d6 Shenghao Ding 2023-06-18 239 /* Create a mixer item for selecting the active profile */
ef3bcde75d06d6 Shenghao Ding 2023-06-18 240 name = devm_kzalloc(tas_priv->dev, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
ef3bcde75d06d6 Shenghao Ding 2023-06-18 241 GFP_KERNEL);
ef3bcde75d06d6 Shenghao Ding 2023-06-18 242 if (!name) {
ef3bcde75d06d6 Shenghao Ding 2023-06-18 243 ret = -ENOMEM;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 244 goto out;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 245 }
ef3bcde75d06d6 Shenghao Ding 2023-06-18 246 scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "Speaker Profile Id");
ef3bcde75d06d6 Shenghao Ding 2023-06-18 247 prof_ctrls[mix_index].name = name;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 248 prof_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 249 prof_ctrls[mix_index].info = tasdevice_info_profile;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 250 prof_ctrls[mix_index].get = tasdevice_get_profile_id;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 251 prof_ctrls[mix_index].put = tasdevice_set_profile_id;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 252 mix_index++;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 253
ef3bcde75d06d6 Shenghao Ding 2023-06-18 254 ret = snd_soc_add_component_controls(tas_priv->codec,
ef3bcde75d06d6 Shenghao Ding 2023-06-18 @255 prof_ctrls, nr_controls < mix_index ? nr_controls : mix_index);
ef3bcde75d06d6 Shenghao Ding 2023-06-18 256
ef3bcde75d06d6 Shenghao Ding 2023-06-18 257 out:
ef3bcde75d06d6 Shenghao Ding 2023-06-18 258 return ret;
ef3bcde75d06d6 Shenghao Ding 2023-06-18 259 }
ef3bcde75d06d6 Shenghao Ding 2023-06-18 260
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-02 11:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-16 16:41 sound/soc/codecs/tas2781-i2c.c:255:26-27: WARNING opportunity for min() kernel test robot
2024-01-02 11:53 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.