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: <202207210041.v4r4dWxB-lkp@intel.com>
Date:   Thu, 21 Jul 2022 01:06:58 +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-07-04-v1 15/23]
 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-07-04-v1
head:   e9efd77b37adcddf8f910f34dd0df06be9d896cb
commit: 2aa8bfec7e0ff4ab531a688f8fd43150ad78ae23 [15/23] ASoC: count activity via TX/RX base instead of Playback/Capture.
config: alpha-buildonly-randconfig-r006-20220719 (https://download.01.org/0day-ci/archive/20220721/202207210041.v4r4dWxB-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/morimoto/linux/commit/2aa8bfec7e0ff4ab531a688f8fd43150ad78ae23
        git remote add morimoto https://github.com/morimoto/linux
        git fetch --no-tags morimoto sound-2022-07-04-v1
        git checkout 2aa8bfec7e0ff4ab531a688f8fd43150ad78ae23
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash drivers/iio/adc/ drivers/staging/greybus/ sound/soc/atmel/ sound/soc/codecs/ sound/soc/fsl/ sound/soc/qcom/ sound/soc/sh/ sound/soc/sunxi/ sound/soc/ti/ sound/soc/uniphier/ sound/soc/xilinx/

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:1350,
                    from sound/soc/codecs/cs4271.c:22:
   include/sound/soc-dai.h:605:55: note: expected 'struct snd_soc_pcm_runtime *' but argument is of type 'struct snd_soc_dai *'
     605 | 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
   include/sound/soc-dai.h:605:80: note: expected 'struct snd_soc_dai *' but argument is of type 'int'
     605 | 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)) ||
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/sound/soc-dai.h:605:1: note: declared here
     605 | 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 *
   include/sound/soc-dai.h:605:55: note: expected 'struct snd_soc_pcm_runtime *' but argument is of type 'struct snd_soc_dai *'
     605 | 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))) {
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/sound/soc-dai.h:605:1: note: declared here
     605 | 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ