* sound/soc/codecs/tas2562.c:200:4: warning: Assignment of function parameter has no effect outside the function.
@ 2020-10-20 7:23 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-20 7:23 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 7306 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Dan Murphy <dmurphy@ti.com>
CC: Mark Brown <broonie@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 270315b8235e3d10c2e360cff56c2f9e0915a252
commit: d7bd40ae55ce339a3c9be7fc2087c671d3d80894 ASoC: tas2562: Add right and left channel slot programming
date: 4 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 4 months ago
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"cppcheck warnings: (new ones prefixed by >>)"
>> sound/soc/codecs/wm8962.c:2787:25: warning: Uninitialized variable: fratio [uninitvar]
fll_div->n = target / (fratio * Fref);
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> sound/soc/codecs/tas2562.c:200:4: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
tx_mask &= ~(1 << right_slot);
^
>> sound/soc/codecs/tas2562.c:518:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
return ret;
^
sound/soc/codecs/tas2562.c:513:6: note: first condition
if (ret)
^
sound/soc/codecs/tas2562.c:518:9: note: second condition
return ret;
^
vim +200 sound/soc/codecs/tas2562.c
c173dba44c2d2e Dan Murphy 2019-10-08 171
c173dba44c2d2e Dan Murphy 2019-10-08 172 static int tas2562_set_dai_tdm_slot(struct snd_soc_dai *dai,
c173dba44c2d2e Dan Murphy 2019-10-08 173 unsigned int tx_mask, unsigned int rx_mask,
c173dba44c2d2e Dan Murphy 2019-10-08 174 int slots, int slot_width)
c173dba44c2d2e Dan Murphy 2019-10-08 175 {
c173dba44c2d2e Dan Murphy 2019-10-08 176 struct snd_soc_component *component = dai->component;
c173dba44c2d2e Dan Murphy 2019-10-08 177 struct tas2562_data *tas2562 = snd_soc_component_get_drvdata(component);
d7bd40ae55ce33 Dan Murphy 2020-06-26 178 int left_slot, right_slot;
d7bd40ae55ce33 Dan Murphy 2020-06-26 179 int slots_cfg;
d7bd40ae55ce33 Dan Murphy 2020-06-26 180 int ret;
d7bd40ae55ce33 Dan Murphy 2020-06-26 181
d7bd40ae55ce33 Dan Murphy 2020-06-26 182 if (!tx_mask) {
d7bd40ae55ce33 Dan Murphy 2020-06-26 183 dev_err(component->dev, "tx masks must not be 0\n");
d7bd40ae55ce33 Dan Murphy 2020-06-26 184 return -EINVAL;
d7bd40ae55ce33 Dan Murphy 2020-06-26 185 }
d7bd40ae55ce33 Dan Murphy 2020-06-26 186
d7bd40ae55ce33 Dan Murphy 2020-06-26 187 if (slots == 1) {
d7bd40ae55ce33 Dan Murphy 2020-06-26 188 if (tx_mask != 1)
d7bd40ae55ce33 Dan Murphy 2020-06-26 189 return -EINVAL;
d7bd40ae55ce33 Dan Murphy 2020-06-26 190
d7bd40ae55ce33 Dan Murphy 2020-06-26 191 left_slot = 0;
d7bd40ae55ce33 Dan Murphy 2020-06-26 192 right_slot = 0;
d7bd40ae55ce33 Dan Murphy 2020-06-26 193 } else {
d7bd40ae55ce33 Dan Murphy 2020-06-26 194 left_slot = __ffs(tx_mask);
d7bd40ae55ce33 Dan Murphy 2020-06-26 195 tx_mask &= ~(1 << left_slot);
d7bd40ae55ce33 Dan Murphy 2020-06-26 196 if (tx_mask == 0) {
d7bd40ae55ce33 Dan Murphy 2020-06-26 197 right_slot = left_slot;
d7bd40ae55ce33 Dan Murphy 2020-06-26 198 } else {
d7bd40ae55ce33 Dan Murphy 2020-06-26 199 right_slot = __ffs(tx_mask);
d7bd40ae55ce33 Dan Murphy 2020-06-26 @200 tx_mask &= ~(1 << right_slot);
d7bd40ae55ce33 Dan Murphy 2020-06-26 201 }
d7bd40ae55ce33 Dan Murphy 2020-06-26 202 }
d7bd40ae55ce33 Dan Murphy 2020-06-26 203
d7bd40ae55ce33 Dan Murphy 2020-06-26 204 slots_cfg = (right_slot << TAS2562_RIGHT_SLOT_SHIFT) | left_slot;
d7bd40ae55ce33 Dan Murphy 2020-06-26 205
d7bd40ae55ce33 Dan Murphy 2020-06-26 206 ret = snd_soc_component_write(component, TAS2562_TDM_CFG3, slots_cfg);
d7bd40ae55ce33 Dan Murphy 2020-06-26 207 if (ret < 0)
d7bd40ae55ce33 Dan Murphy 2020-06-26 208 return ret;
c173dba44c2d2e Dan Murphy 2019-10-08 209
c173dba44c2d2e Dan Murphy 2019-10-08 210 switch (slot_width) {
c173dba44c2d2e Dan Murphy 2019-10-08 211 case 16:
c173dba44c2d2e Dan Murphy 2019-10-08 212 ret = snd_soc_component_update_bits(component,
c173dba44c2d2e Dan Murphy 2019-10-08 213 TAS2562_TDM_CFG2,
c173dba44c2d2e Dan Murphy 2019-10-08 214 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2e Dan Murphy 2019-10-08 215 TAS2562_TDM_CFG2_RXLEN_16B);
c173dba44c2d2e Dan Murphy 2019-10-08 216 break;
c173dba44c2d2e Dan Murphy 2019-10-08 217 case 24:
c173dba44c2d2e Dan Murphy 2019-10-08 218 ret = snd_soc_component_update_bits(component,
c173dba44c2d2e Dan Murphy 2019-10-08 219 TAS2562_TDM_CFG2,
c173dba44c2d2e Dan Murphy 2019-10-08 220 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2e Dan Murphy 2019-10-08 221 TAS2562_TDM_CFG2_RXLEN_24B);
c173dba44c2d2e Dan Murphy 2019-10-08 222 break;
c173dba44c2d2e Dan Murphy 2019-10-08 223 case 32:
c173dba44c2d2e Dan Murphy 2019-10-08 224 ret = snd_soc_component_update_bits(component,
c173dba44c2d2e Dan Murphy 2019-10-08 225 TAS2562_TDM_CFG2,
c173dba44c2d2e Dan Murphy 2019-10-08 226 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2e Dan Murphy 2019-10-08 227 TAS2562_TDM_CFG2_RXLEN_32B);
c173dba44c2d2e Dan Murphy 2019-10-08 228 break;
c173dba44c2d2e Dan Murphy 2019-10-08 229
c173dba44c2d2e Dan Murphy 2019-10-08 230 case 0:
c173dba44c2d2e Dan Murphy 2019-10-08 231 /* Do not change slot width */
c173dba44c2d2e Dan Murphy 2019-10-08 232 break;
c173dba44c2d2e Dan Murphy 2019-10-08 233 default:
c173dba44c2d2e Dan Murphy 2019-10-08 234 dev_err(tas2562->dev, "slot width not supported");
c173dba44c2d2e Dan Murphy 2019-10-08 235 ret = -EINVAL;
c173dba44c2d2e Dan Murphy 2019-10-08 236 }
c173dba44c2d2e Dan Murphy 2019-10-08 237
c173dba44c2d2e Dan Murphy 2019-10-08 238 if (ret < 0)
c173dba44c2d2e Dan Murphy 2019-10-08 239 return ret;
c173dba44c2d2e Dan Murphy 2019-10-08 240
d7bd40ae55ce33 Dan Murphy 2020-06-26 241 ret = snd_soc_component_update_bits(component, TAS2562_TDM_CFG5,
d7bd40ae55ce33 Dan Murphy 2020-06-26 242 TAS2562_TDM_CFG5_VSNS_SLOT_MASK,
d7bd40ae55ce33 Dan Murphy 2020-06-26 243 tas2562->v_sense_slot);
d7bd40ae55ce33 Dan Murphy 2020-06-26 244 if (ret < 0)
d7bd40ae55ce33 Dan Murphy 2020-06-26 245 return ret;
d7bd40ae55ce33 Dan Murphy 2020-06-26 246
d7bd40ae55ce33 Dan Murphy 2020-06-26 247 ret = snd_soc_component_update_bits(component, TAS2562_TDM_CFG6,
d7bd40ae55ce33 Dan Murphy 2020-06-26 248 TAS2562_TDM_CFG6_ISNS_SLOT_MASK,
d7bd40ae55ce33 Dan Murphy 2020-06-26 249 tas2562->i_sense_slot);
d7bd40ae55ce33 Dan Murphy 2020-06-26 250 if (ret < 0)
d7bd40ae55ce33 Dan Murphy 2020-06-26 251 return ret;
d7bd40ae55ce33 Dan Murphy 2020-06-26 252
c173dba44c2d2e Dan Murphy 2019-10-08 253 return 0;
c173dba44c2d2e Dan Murphy 2019-10-08 254 }
c173dba44c2d2e Dan Murphy 2019-10-08 255
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread* sound/soc/codecs/tas2562.c:200:4: warning: Assignment of function parameter has no effect outside the function.
@ 2020-12-29 9:00 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-12-29 9:00 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 7269 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Dan Murphy <dmurphy@ti.com>
CC: Mark Brown <broonie@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
commit: d7bd40ae55ce339a3c9be7fc2087c671d3d80894 ASoC: tas2562: Add right and left channel slot programming
date: 6 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 6 months ago
compiler: arceb-elf-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"cppcheck warnings: (new ones prefixed by >>)"
>> sound/soc/codecs/wm8962.c:2787:25: warning: Uninitialized variable: fratio [uninitvar]
fll_div->n = target / (fratio * Fref);
^
--
>> sound/soc/codecs/tscs454.c:730:37: warning: Same value in both branches of ternary operator. [duplicateValueTernary]
val = pll1 ? FV_PLL1CLKEN_DISABLE : FV_PLL2CLKEN_DISABLE;
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> sound/soc/codecs/tas2562.c:200:4: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
tx_mask &= ~(1 << right_slot);
^
vim +200 sound/soc/codecs/tas2562.c
c173dba44c2d2ec Dan Murphy 2019-10-08 171
c173dba44c2d2ec Dan Murphy 2019-10-08 172 static int tas2562_set_dai_tdm_slot(struct snd_soc_dai *dai,
c173dba44c2d2ec Dan Murphy 2019-10-08 173 unsigned int tx_mask, unsigned int rx_mask,
c173dba44c2d2ec Dan Murphy 2019-10-08 174 int slots, int slot_width)
c173dba44c2d2ec Dan Murphy 2019-10-08 175 {
c173dba44c2d2ec Dan Murphy 2019-10-08 176 struct snd_soc_component *component = dai->component;
c173dba44c2d2ec Dan Murphy 2019-10-08 177 struct tas2562_data *tas2562 = snd_soc_component_get_drvdata(component);
d7bd40ae55ce339 Dan Murphy 2020-06-26 178 int left_slot, right_slot;
d7bd40ae55ce339 Dan Murphy 2020-06-26 179 int slots_cfg;
d7bd40ae55ce339 Dan Murphy 2020-06-26 180 int ret;
d7bd40ae55ce339 Dan Murphy 2020-06-26 181
d7bd40ae55ce339 Dan Murphy 2020-06-26 182 if (!tx_mask) {
d7bd40ae55ce339 Dan Murphy 2020-06-26 183 dev_err(component->dev, "tx masks must not be 0\n");
d7bd40ae55ce339 Dan Murphy 2020-06-26 184 return -EINVAL;
d7bd40ae55ce339 Dan Murphy 2020-06-26 185 }
d7bd40ae55ce339 Dan Murphy 2020-06-26 186
d7bd40ae55ce339 Dan Murphy 2020-06-26 187 if (slots == 1) {
d7bd40ae55ce339 Dan Murphy 2020-06-26 188 if (tx_mask != 1)
d7bd40ae55ce339 Dan Murphy 2020-06-26 189 return -EINVAL;
d7bd40ae55ce339 Dan Murphy 2020-06-26 190
d7bd40ae55ce339 Dan Murphy 2020-06-26 191 left_slot = 0;
d7bd40ae55ce339 Dan Murphy 2020-06-26 192 right_slot = 0;
d7bd40ae55ce339 Dan Murphy 2020-06-26 193 } else {
d7bd40ae55ce339 Dan Murphy 2020-06-26 194 left_slot = __ffs(tx_mask);
d7bd40ae55ce339 Dan Murphy 2020-06-26 195 tx_mask &= ~(1 << left_slot);
d7bd40ae55ce339 Dan Murphy 2020-06-26 196 if (tx_mask == 0) {
d7bd40ae55ce339 Dan Murphy 2020-06-26 197 right_slot = left_slot;
d7bd40ae55ce339 Dan Murphy 2020-06-26 198 } else {
d7bd40ae55ce339 Dan Murphy 2020-06-26 199 right_slot = __ffs(tx_mask);
d7bd40ae55ce339 Dan Murphy 2020-06-26 @200 tx_mask &= ~(1 << right_slot);
d7bd40ae55ce339 Dan Murphy 2020-06-26 201 }
d7bd40ae55ce339 Dan Murphy 2020-06-26 202 }
d7bd40ae55ce339 Dan Murphy 2020-06-26 203
d7bd40ae55ce339 Dan Murphy 2020-06-26 204 slots_cfg = (right_slot << TAS2562_RIGHT_SLOT_SHIFT) | left_slot;
d7bd40ae55ce339 Dan Murphy 2020-06-26 205
d7bd40ae55ce339 Dan Murphy 2020-06-26 206 ret = snd_soc_component_write(component, TAS2562_TDM_CFG3, slots_cfg);
d7bd40ae55ce339 Dan Murphy 2020-06-26 207 if (ret < 0)
d7bd40ae55ce339 Dan Murphy 2020-06-26 208 return ret;
c173dba44c2d2ec Dan Murphy 2019-10-08 209
c173dba44c2d2ec Dan Murphy 2019-10-08 210 switch (slot_width) {
c173dba44c2d2ec Dan Murphy 2019-10-08 211 case 16:
c173dba44c2d2ec Dan Murphy 2019-10-08 212 ret = snd_soc_component_update_bits(component,
c173dba44c2d2ec Dan Murphy 2019-10-08 213 TAS2562_TDM_CFG2,
c173dba44c2d2ec Dan Murphy 2019-10-08 214 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2ec Dan Murphy 2019-10-08 215 TAS2562_TDM_CFG2_RXLEN_16B);
c173dba44c2d2ec Dan Murphy 2019-10-08 216 break;
c173dba44c2d2ec Dan Murphy 2019-10-08 217 case 24:
c173dba44c2d2ec Dan Murphy 2019-10-08 218 ret = snd_soc_component_update_bits(component,
c173dba44c2d2ec Dan Murphy 2019-10-08 219 TAS2562_TDM_CFG2,
c173dba44c2d2ec Dan Murphy 2019-10-08 220 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2ec Dan Murphy 2019-10-08 221 TAS2562_TDM_CFG2_RXLEN_24B);
c173dba44c2d2ec Dan Murphy 2019-10-08 222 break;
c173dba44c2d2ec Dan Murphy 2019-10-08 223 case 32:
c173dba44c2d2ec Dan Murphy 2019-10-08 224 ret = snd_soc_component_update_bits(component,
c173dba44c2d2ec Dan Murphy 2019-10-08 225 TAS2562_TDM_CFG2,
c173dba44c2d2ec Dan Murphy 2019-10-08 226 TAS2562_TDM_CFG2_RXLEN_MASK,
c173dba44c2d2ec Dan Murphy 2019-10-08 227 TAS2562_TDM_CFG2_RXLEN_32B);
c173dba44c2d2ec Dan Murphy 2019-10-08 228 break;
c173dba44c2d2ec Dan Murphy 2019-10-08 229
c173dba44c2d2ec Dan Murphy 2019-10-08 230 case 0:
c173dba44c2d2ec Dan Murphy 2019-10-08 231 /* Do not change slot width */
c173dba44c2d2ec Dan Murphy 2019-10-08 232 break;
c173dba44c2d2ec Dan Murphy 2019-10-08 233 default:
c173dba44c2d2ec Dan Murphy 2019-10-08 234 dev_err(tas2562->dev, "slot width not supported");
c173dba44c2d2ec Dan Murphy 2019-10-08 235 ret = -EINVAL;
c173dba44c2d2ec Dan Murphy 2019-10-08 236 }
c173dba44c2d2ec Dan Murphy 2019-10-08 237
c173dba44c2d2ec Dan Murphy 2019-10-08 238 if (ret < 0)
c173dba44c2d2ec Dan Murphy 2019-10-08 239 return ret;
c173dba44c2d2ec Dan Murphy 2019-10-08 240
d7bd40ae55ce339 Dan Murphy 2020-06-26 241 ret = snd_soc_component_update_bits(component, TAS2562_TDM_CFG5,
d7bd40ae55ce339 Dan Murphy 2020-06-26 242 TAS2562_TDM_CFG5_VSNS_SLOT_MASK,
d7bd40ae55ce339 Dan Murphy 2020-06-26 243 tas2562->v_sense_slot);
d7bd40ae55ce339 Dan Murphy 2020-06-26 244 if (ret < 0)
d7bd40ae55ce339 Dan Murphy 2020-06-26 245 return ret;
d7bd40ae55ce339 Dan Murphy 2020-06-26 246
d7bd40ae55ce339 Dan Murphy 2020-06-26 247 ret = snd_soc_component_update_bits(component, TAS2562_TDM_CFG6,
d7bd40ae55ce339 Dan Murphy 2020-06-26 248 TAS2562_TDM_CFG6_ISNS_SLOT_MASK,
d7bd40ae55ce339 Dan Murphy 2020-06-26 249 tas2562->i_sense_slot);
d7bd40ae55ce339 Dan Murphy 2020-06-26 250 if (ret < 0)
d7bd40ae55ce339 Dan Murphy 2020-06-26 251 return ret;
d7bd40ae55ce339 Dan Murphy 2020-06-26 252
c173dba44c2d2ec Dan Murphy 2019-10-08 253 return 0;
c173dba44c2d2ec Dan Murphy 2019-10-08 254 }
c173dba44c2d2ec Dan Murphy 2019-10-08 255
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-29 9:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-20 7:23 sound/soc/codecs/tas2562.c:200:4: warning: Assignment of function parameter has no effect outside the function kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-12-29 9:00 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.