All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/soc/bcm/bcm63xx-i2s-whistler.c:161:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour
@ 2021-01-29  3:46 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-01-29  3:46 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5828 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Kevin Li <kevin-ke.li@broadcom.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   909b447dcc45db2f9bd5f495f1d16c419812e6df
commit: 88eb404ccc3efd300fb6fb6a9f8c99c1d5db3747 ASoC: brcm: Add DSL/PON SoC audio driver
date:   11 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 11 months ago
compiler: hppa-linux-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);
                           ^

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> sound/soc/bcm/bcm63xx-i2s-whistler.c:161:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
      enabled = enabled & I2S_RX_ENABLE_MASK;
                          ^
   sound/soc/bcm/bcm63xx-i2s-whistler.c:182:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
      enabled = enabled & I2S_TX_ENABLE_MASK;
                          ^
--
>> sound/soc/codecs/rt5670.c:2490:61: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
     (pll_code.m_bp ? 0 : pll_code.m_code) << RT5670_PLL_M_SFT |
                                                               ^

vim +161 sound/soc/bcm/bcm63xx-i2s-whistler.c

88eb404ccc3efd Kevin Li 2020-03-12  141  
88eb404ccc3efd Kevin Li 2020-03-12  142  static void bcm63xx_i2s_shutdown(struct snd_pcm_substream *substream,
88eb404ccc3efd Kevin Li 2020-03-12  143  				struct snd_soc_dai *dai)
88eb404ccc3efd Kevin Li 2020-03-12  144  {
88eb404ccc3efd Kevin Li 2020-03-12  145  	unsigned int enabled, slavemode;
88eb404ccc3efd Kevin Li 2020-03-12  146  	struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai);
88eb404ccc3efd Kevin Li 2020-03-12  147  	struct regmap *regmap_i2s = i2s_priv->regmap_i2s;
88eb404ccc3efd Kevin Li 2020-03-12  148  
88eb404ccc3efd Kevin Li 2020-03-12  149  	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
88eb404ccc3efd Kevin Li 2020-03-12  150  		regmap_update_bits(regmap_i2s, I2S_TX_CFG,
88eb404ccc3efd Kevin Li 2020-03-12  151  				   I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT |
88eb404ccc3efd Kevin Li 2020-03-12  152  				   I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, 0);
88eb404ccc3efd Kevin Li 2020-03-12  153  		regmap_write(regmap_i2s, I2S_TX_IRQ_CTL, 1);
88eb404ccc3efd Kevin Li 2020-03-12  154  		regmap_write(regmap_i2s, I2S_TX_IRQ_IFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  155  		regmap_write(regmap_i2s, I2S_TX_IRQ_OFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  156  
88eb404ccc3efd Kevin Li 2020-03-12  157  		regmap_read(regmap_i2s, I2S_TX_CFG_2, &slavemode);
88eb404ccc3efd Kevin Li 2020-03-12  158  		slavemode = slavemode & I2S_TX_SLAVE_MODE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  159  		if (!slavemode) {
88eb404ccc3efd Kevin Li 2020-03-12  160  			regmap_read(regmap_i2s, I2S_RX_CFG, &enabled);
88eb404ccc3efd Kevin Li 2020-03-12 @161  			enabled = enabled & I2S_RX_ENABLE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  162  			if (enabled)
88eb404ccc3efd Kevin Li 2020-03-12  163  				regmap_update_bits(regmap_i2s, I2S_RX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  164  						   I2S_RX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  165  						   I2S_RX_MASTER_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  166  		}
88eb404ccc3efd Kevin Li 2020-03-12  167  		regmap_update_bits(regmap_i2s, I2S_TX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  168  				   I2S_TX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  169  				   I2S_TX_SLAVE_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  170  	} else {
88eb404ccc3efd Kevin Li 2020-03-12  171  		regmap_update_bits(regmap_i2s, I2S_RX_CFG,
88eb404ccc3efd Kevin Li 2020-03-12  172  				   I2S_RX_IN_R | I2S_RX_DATA_ALIGNMENT |
88eb404ccc3efd Kevin Li 2020-03-12  173  				   I2S_RX_CLOCK_ENABLE, 0);
88eb404ccc3efd Kevin Li 2020-03-12  174  		regmap_write(regmap_i2s, I2S_RX_IRQ_CTL, 1);
88eb404ccc3efd Kevin Li 2020-03-12  175  		regmap_write(regmap_i2s, I2S_RX_IRQ_IFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  176  		regmap_write(regmap_i2s, I2S_RX_IRQ_OFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  177  
88eb404ccc3efd Kevin Li 2020-03-12  178  		regmap_read(regmap_i2s, I2S_RX_CFG_2, &slavemode);
88eb404ccc3efd Kevin Li 2020-03-12  179  		slavemode = slavemode & I2S_RX_SLAVE_MODE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  180  		if (!slavemode) {
88eb404ccc3efd Kevin Li 2020-03-12  181  			regmap_read(regmap_i2s, I2S_TX_CFG, &enabled);
88eb404ccc3efd Kevin Li 2020-03-12  182  			enabled = enabled & I2S_TX_ENABLE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  183  			if (enabled)
88eb404ccc3efd Kevin Li 2020-03-12  184  				regmap_update_bits(regmap_i2s, I2S_TX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  185  						   I2S_TX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  186  						   I2S_TX_MASTER_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  187  		}
88eb404ccc3efd Kevin Li 2020-03-12  188  
88eb404ccc3efd Kevin Li 2020-03-12  189  		regmap_update_bits(regmap_i2s, I2S_RX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  190  				   I2S_RX_SLAVE_MODE_MASK, I2S_RX_SLAVE_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  191  	}
88eb404ccc3efd Kevin Li 2020-03-12  192  }
88eb404ccc3efd Kevin Li 2020-03-12  193  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* sound/soc/bcm/bcm63xx-i2s-whistler.c:161:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour
@ 2021-02-18 19:24 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-02-18 19:24 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6355 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Kevin Li <kevin-ke.li@broadcom.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f40ddce88593482919761f74910f42f4b84c004b
commit: 88eb404ccc3efd300fb6fb6a9f8c99c1d5db3747 ASoC: brcm: Add DSL/PON SoC audio driver
date:   11 months ago
:::::: branch date: 4 days ago
:::::: commit date: 11 months ago
compiler: powerpc64-linux-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 possible warnings: (new ones prefixed by >>, may not real problems)

>> sound/soc/bcm/bcm63xx-i2s-whistler.c:161:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
      enabled = enabled & I2S_RX_ENABLE_MASK;
                          ^
   sound/soc/bcm/bcm63xx-i2s-whistler.c:182:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned]
      enabled = enabled & I2S_TX_ENABLE_MASK;
                          ^
--
>> sound/soc/codecs/rt5645.c:2973:61: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
     (pll_code.m_bp ? 0 : pll_code.m_code) << RT5645_PLL_M_SFT |
                                                               ^
>> sound/soc/codecs/rt5682.c:2391:65: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
         (pll_code.m_bp ? 0 : pll_code.m_code) << RT5682_PLL_M_SFT |
                                                                   ^
>> sound/soc/codecs/rt5682.c:2730:7: warning: Either the condition '!dai' is redundant or there is possible null pointer dereference: dai. [nullPointerRedundantCheck]
     if (dai->id == RT5682_AIF1)
         ^
   sound/soc/codecs/rt5682.c:2732:6: note: Assuming that condition '!dai' is not redundant
    if (!dai) {
        ^
   sound/soc/codecs/rt5682.c:2730:7: note: Null pointer dereference
     if (dai->id == RT5682_AIF1)
         ^

vim +161 sound/soc/bcm/bcm63xx-i2s-whistler.c

88eb404ccc3efd Kevin Li 2020-03-12  141  
88eb404ccc3efd Kevin Li 2020-03-12  142  static void bcm63xx_i2s_shutdown(struct snd_pcm_substream *substream,
88eb404ccc3efd Kevin Li 2020-03-12  143  				struct snd_soc_dai *dai)
88eb404ccc3efd Kevin Li 2020-03-12  144  {
88eb404ccc3efd Kevin Li 2020-03-12  145  	unsigned int enabled, slavemode;
88eb404ccc3efd Kevin Li 2020-03-12  146  	struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai);
88eb404ccc3efd Kevin Li 2020-03-12  147  	struct regmap *regmap_i2s = i2s_priv->regmap_i2s;
88eb404ccc3efd Kevin Li 2020-03-12  148  
88eb404ccc3efd Kevin Li 2020-03-12  149  	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
88eb404ccc3efd Kevin Li 2020-03-12  150  		regmap_update_bits(regmap_i2s, I2S_TX_CFG,
88eb404ccc3efd Kevin Li 2020-03-12  151  				   I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT |
88eb404ccc3efd Kevin Li 2020-03-12  152  				   I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, 0);
88eb404ccc3efd Kevin Li 2020-03-12  153  		regmap_write(regmap_i2s, I2S_TX_IRQ_CTL, 1);
88eb404ccc3efd Kevin Li 2020-03-12  154  		regmap_write(regmap_i2s, I2S_TX_IRQ_IFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  155  		regmap_write(regmap_i2s, I2S_TX_IRQ_OFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  156  
88eb404ccc3efd Kevin Li 2020-03-12  157  		regmap_read(regmap_i2s, I2S_TX_CFG_2, &slavemode);
88eb404ccc3efd Kevin Li 2020-03-12  158  		slavemode = slavemode & I2S_TX_SLAVE_MODE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  159  		if (!slavemode) {
88eb404ccc3efd Kevin Li 2020-03-12  160  			regmap_read(regmap_i2s, I2S_RX_CFG, &enabled);
88eb404ccc3efd Kevin Li 2020-03-12 @161  			enabled = enabled & I2S_RX_ENABLE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  162  			if (enabled)
88eb404ccc3efd Kevin Li 2020-03-12  163  				regmap_update_bits(regmap_i2s, I2S_RX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  164  						   I2S_RX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  165  						   I2S_RX_MASTER_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  166  		}
88eb404ccc3efd Kevin Li 2020-03-12  167  		regmap_update_bits(regmap_i2s, I2S_TX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  168  				   I2S_TX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  169  				   I2S_TX_SLAVE_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  170  	} else {
88eb404ccc3efd Kevin Li 2020-03-12  171  		regmap_update_bits(regmap_i2s, I2S_RX_CFG,
88eb404ccc3efd Kevin Li 2020-03-12  172  				   I2S_RX_IN_R | I2S_RX_DATA_ALIGNMENT |
88eb404ccc3efd Kevin Li 2020-03-12  173  				   I2S_RX_CLOCK_ENABLE, 0);
88eb404ccc3efd Kevin Li 2020-03-12  174  		regmap_write(regmap_i2s, I2S_RX_IRQ_CTL, 1);
88eb404ccc3efd Kevin Li 2020-03-12  175  		regmap_write(regmap_i2s, I2S_RX_IRQ_IFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  176  		regmap_write(regmap_i2s, I2S_RX_IRQ_OFF_THLD, 4);
88eb404ccc3efd Kevin Li 2020-03-12  177  
88eb404ccc3efd Kevin Li 2020-03-12  178  		regmap_read(regmap_i2s, I2S_RX_CFG_2, &slavemode);
88eb404ccc3efd Kevin Li 2020-03-12  179  		slavemode = slavemode & I2S_RX_SLAVE_MODE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  180  		if (!slavemode) {
88eb404ccc3efd Kevin Li 2020-03-12  181  			regmap_read(regmap_i2s, I2S_TX_CFG, &enabled);
88eb404ccc3efd Kevin Li 2020-03-12  182  			enabled = enabled & I2S_TX_ENABLE_MASK;
88eb404ccc3efd Kevin Li 2020-03-12  183  			if (enabled)
88eb404ccc3efd Kevin Li 2020-03-12  184  				regmap_update_bits(regmap_i2s, I2S_TX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  185  						   I2S_TX_SLAVE_MODE_MASK,
88eb404ccc3efd Kevin Li 2020-03-12  186  						   I2S_TX_MASTER_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  187  		}
88eb404ccc3efd Kevin Li 2020-03-12  188  
88eb404ccc3efd Kevin Li 2020-03-12  189  		regmap_update_bits(regmap_i2s, I2S_RX_CFG_2,
88eb404ccc3efd Kevin Li 2020-03-12  190  				   I2S_RX_SLAVE_MODE_MASK, I2S_RX_SLAVE_MODE);
88eb404ccc3efd Kevin Li 2020-03-12  191  	}
88eb404ccc3efd Kevin Li 2020-03-12  192  }
88eb404ccc3efd Kevin Li 2020-03-12  193  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-18 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  3:46 sound/soc/bcm/bcm63xx-i2s-whistler.c:161:24: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour kernel test robot
2021-02-18 19:24 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.