lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202206301624.UFfIkXeV-lkp@intel.com>
Date:   Thu, 30 Jun 2022 16:02:49 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [morimoto:sound-2022-06-30-v3 11/19]
 sound/soc/codecs/cs4271.c:359:54: warning: passing argument 2 of
 'snd_soc_dai_stream_active' makes pointer from integer without a cast

tree:   https://github.com/morimoto/linux sound-2022-06-30-v3
head:   fc6f65d23a318462b8e17cdf7db622dfc7719ac7
commit: 13230e877cbc275ad58da98eca3f64ae9775afb9 [11/19] ASoC: count activity via TX/RX base instead of Playback/Capture.
config: i386-allyesconfig
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/morimoto/linux/commit/13230e877cbc275ad58da98eca3f64ae9775afb9
        git remote add morimoto https://github.com/morimoto/linux
        git fetch --no-tags morimoto sound-2022-06-30-v3
        git checkout 13230e877cbc275ad58da98eca3f64ae9775afb9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/media/i2c/ drivers/soundwire/ drivers/staging/greybus/ sound/soc/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   sound/soc/codecs/cs4271.c: In function 'cs4271_hw_params':
   sound/soc/codecs/cs4271.c:359:49: error: passing argument 1 of 'snd_soc_dai_stream_active' from incompatible pointer type [-Werror=incompatible-pointer-types]
     359 |                      !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_CAPTURE)) ||
         |                                                 ^~~
         |                                                 |
         |                                                 struct snd_soc_dai *
   In file included from include/sound/soc.h:1338,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:606:55: note: expected 'struct snd_soc_pcm_runtime *' but argument is of type 'struct snd_soc_dai *'
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
>> sound/soc/codecs/cs4271.c:359:54: warning: passing argument 2 of 'snd_soc_dai_stream_active' makes pointer from integer without a cast [-Wint-conversion]
     359 |                      !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_CAPTURE)) ||
         |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
         |                                                      |
         |                                                      int
   In file included from include/sound/soc.h:1338,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:606:80: note: expected 'struct snd_soc_dai *' but argument is of type 'int'
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         |                                                            ~~~~~~~~~~~~~~~~~~~~^~~
   sound/soc/codecs/cs4271.c:359:23: error: too few arguments to function 'snd_soc_dai_stream_active'
     359 |                      !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_CAPTURE)) ||
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/sound/soc.h:1338,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:606:1: note: declared here
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs4271.c:361:49: error: passing argument 1 of 'snd_soc_dai_stream_active' from incompatible pointer type [-Werror=incompatible-pointer-types]
     361 |                      !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_PLAYBACK))) {
         |                                                 ^~~
         |                                                 |
         |                                                 struct snd_soc_dai *
   In file included from include/sound/soc.h:1338,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:606:55: note: expected 'struct snd_soc_pcm_runtime *' but argument is of type 'struct snd_soc_dai *'
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   sound/soc/codecs/cs4271.c:361:23: error: too few arguments to function 'snd_soc_dai_stream_active'
     361 |                      !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_PLAYBACK))) {
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/sound/soc.h:1338,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:606:1: note: declared here
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/soc/dwc/dwc-i2s.c: In function 'dw_i2s_resume':
   sound/soc/dwc/dwc-i2s.c:439:55: error: passing argument 1 of 'snd_soc_dai_stream_active' from incompatible pointer type [-Werror=incompatible-pointer-types]
     439 |                         if (snd_soc_dai_stream_active(dai, stream))
         |                                                       ^~~
         |                                                       |
         |                                                       struct snd_soc_dai *
   In file included from include/sound/soc.h:1338,
                    from sound/soc/dwc/dwc-i2s.c:25:
   include/sound/soc-dai.h:606:55: note: expected 'struct snd_soc_pcm_runtime *' but argument is of type 'struct snd_soc_dai *'
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
>> sound/soc/dwc/dwc-i2s.c:439:60: warning: passing argument 2 of 'snd_soc_dai_stream_active' makes pointer from integer without a cast [-Wint-conversion]
     439 |                         if (snd_soc_dai_stream_active(dai, stream))
         |                                                            ^~~~~~
         |                                                            |
         |                                                            int
   In file included from include/sound/soc.h:1338,
                    from sound/soc/dwc/dwc-i2s.c:25:
   include/sound/soc-dai.h:606:80: note: expected 'struct snd_soc_dai *' but argument is of type 'int'
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         |                                                            ~~~~~~~~~~~~~~~~~~~~^~~
   sound/soc/dwc/dwc-i2s.c:439:29: error: too few arguments to function 'snd_soc_dai_stream_active'
     439 |                         if (snd_soc_dai_stream_active(dai, stream))
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/sound/soc.h:1338,
                    from sound/soc/dwc/dwc-i2s.c:25:
   include/sound/soc-dai.h:606:1: note: declared here
     606 | snd_soc_dai_stream_active(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai, int stream)
         | ^~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/snd_soc_dai_stream_active +359 sound/soc/codecs/cs4271.c

5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  338  
67b22517d8e48a Alexander Sverdlin 2011-01-19  339  static int cs4271_hw_params(struct snd_pcm_substream *substream,
67b22517d8e48a Alexander Sverdlin 2011-01-19  340  			    struct snd_pcm_hw_params *params,
67b22517d8e48a Alexander Sverdlin 2011-01-19  341  			    struct snd_soc_dai *dai)
67b22517d8e48a Alexander Sverdlin 2011-01-19  342  {
cac308fcd767a0 Kuninori Morimoto  2018-01-29  343  	struct snd_soc_component *component = dai->component;
cac308fcd767a0 Kuninori Morimoto  2018-01-29  344  	struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component);
0d42e6e77f8b87 Alexander Sverdlin 2011-01-21  345  	int i, ret;
0d42e6e77f8b87 Alexander Sverdlin 2011-01-21  346  	unsigned int ratio, val;
67b22517d8e48a Alexander Sverdlin 2011-01-19  347  
fd23fb9f6bfd43 Daniel Mack        2012-12-10  348  	if (cs4271->enable_soft_reset) {
fd23fb9f6bfd43 Daniel Mack        2012-12-10  349  		/*
fd23fb9f6bfd43 Daniel Mack        2012-12-10  350  		 * Put the codec in soft reset and back again in case it's not
fd23fb9f6bfd43 Daniel Mack        2012-12-10  351  		 * currently streaming data. This way of bringing the codec in
fd23fb9f6bfd43 Daniel Mack        2012-12-10  352  		 * sync to the current clocks is not explicitly documented in
fd23fb9f6bfd43 Daniel Mack        2012-12-10  353  		 * the data sheet, but it seems to work fine, and in contrast
fd23fb9f6bfd43 Daniel Mack        2012-12-10  354  		 * to a read hardware reset, we don't have to sync back all
fd23fb9f6bfd43 Daniel Mack        2012-12-10  355  		 * registers every time.
fd23fb9f6bfd43 Daniel Mack        2012-12-10  356  		 */
fd23fb9f6bfd43 Daniel Mack        2012-12-10  357  
fd23fb9f6bfd43 Daniel Mack        2012-12-10  358  		if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
5e518eddd11e8f Kuninori Morimoto  2020-05-15 @359  		     !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_CAPTURE)) ||
fd23fb9f6bfd43 Daniel Mack        2012-12-10  360  		    (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&
5e518eddd11e8f Kuninori Morimoto  2020-05-15  361  		     !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_PLAYBACK))) {
1b1861ead4f9fd Daniel Mack        2013-03-07  362  			ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
fd23fb9f6bfd43 Daniel Mack        2012-12-10  363  						 CS4271_MODE2_PDN,
fd23fb9f6bfd43 Daniel Mack        2012-12-10  364  						 CS4271_MODE2_PDN);
fd23fb9f6bfd43 Daniel Mack        2012-12-10  365  			if (ret < 0)
fd23fb9f6bfd43 Daniel Mack        2012-12-10  366  				return ret;
fd23fb9f6bfd43 Daniel Mack        2012-12-10  367  
1b1861ead4f9fd Daniel Mack        2013-03-07  368  			ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
fd23fb9f6bfd43 Daniel Mack        2012-12-10  369  						 CS4271_MODE2_PDN, 0);
fd23fb9f6bfd43 Daniel Mack        2012-12-10  370  			if (ret < 0)
fd23fb9f6bfd43 Daniel Mack        2012-12-10  371  				return ret;
fd23fb9f6bfd43 Daniel Mack        2012-12-10  372  		}
fd23fb9f6bfd43 Daniel Mack        2012-12-10  373  	}
fd23fb9f6bfd43 Daniel Mack        2012-12-10  374  
67b22517d8e48a Alexander Sverdlin 2011-01-19  375  	cs4271->rate = params_rate(params);
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  376  
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  377  	/* Configure DAC */
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  378  	if (cs4271->rate < 50000)
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  379  		val = CS4271_MODE1_MODE_1X;
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  380  	else if (cs4271->rate < 100000)
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  381  		val = CS4271_MODE1_MODE_2X;
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  382  	else
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  383  		val = CS4271_MODE1_MODE_4X;
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  384  
67b22517d8e48a Alexander Sverdlin 2011-01-19  385  	ratio = cs4271->mclk / cs4271->rate;
0c03e37af47efc Christophe JAILLET 2019-07-24  386  	for (i = 0; i < CS4271_NR_RATIOS; i++)
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  387  		if ((cs4271_clk_tab[i].master == cs4271->master) &&
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  388  		    (cs4271_clk_tab[i].speed_mode == val) &&
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  389  		    (cs4271_clk_tab[i].ratio == ratio))
67b22517d8e48a Alexander Sverdlin 2011-01-19  390  			break;
67b22517d8e48a Alexander Sverdlin 2011-01-19  391  
0c03e37af47efc Christophe JAILLET 2019-07-24  392  	if (i == CS4271_NR_RATIOS) {
cac308fcd767a0 Kuninori Morimoto  2018-01-29  393  		dev_err(component->dev, "Invalid sample rate\n");
67b22517d8e48a Alexander Sverdlin 2011-01-19  394  		return -EINVAL;
67b22517d8e48a Alexander Sverdlin 2011-01-19  395  	}
67b22517d8e48a Alexander Sverdlin 2011-01-19  396  
5c3a12e96c9f31 Alexander Sverdlin 2011-03-07  397  	val |= cs4271_clk_tab[i].ratio_mask;
67b22517d8e48a Alexander Sverdlin 2011-01-19  398  
1b1861ead4f9fd Daniel Mack        2013-03-07  399  	ret = regmap_update_bits(cs4271->regmap, CS4271_MODE1,
67b22517d8e48a Alexander Sverdlin 2011-01-19  400  		CS4271_MODE1_MODE_MASK | CS4271_MODE1_DIV_MASK, val);
0d42e6e77f8b87 Alexander Sverdlin 2011-01-21  401  	if (ret < 0)
0d42e6e77f8b87 Alexander Sverdlin 2011-01-21  402  		return ret;
67b22517d8e48a Alexander Sverdlin 2011-01-19  403  
cac308fcd767a0 Kuninori Morimoto  2018-01-29  404  	return cs4271_set_deemph(component);
67b22517d8e48a Alexander Sverdlin 2011-01-19  405  }
67b22517d8e48a Alexander Sverdlin 2011-01-19  406  

:::::: The code at line 359 was first introduced by commit
:::::: 5e518eddd11e8f71aaffc954dc7ee9572fc59808 ASoC: codecs: use snd_soc_xxx_active()

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
:::::: CC: Mark Brown <broonie@...nel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (284210 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ