[PATCH v7 2/3] rename variables from tas2764 to tas27xx

kernel test robot lkp at intel.com
Sat Apr 9 20:13:48 CEST 2022


Hi Raphael-Xu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on v5.18-rc1 next-20220408]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Raphael-Xu/rename-tas2764-to-tas27xx/20220409-203153
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: sparc64-randconfig-s031-20220409 (https://download.01.org/0day-ci/archive/20220410/202204100206.lA9gnwWM-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/intel-lab-lkp/linux/commit/a593d3d588870acd87dad48119f08dc685c4e65e
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Raphael-Xu/rename-tas2764-to-tas27xx/20220409-203153
        git checkout a593d3d588870acd87dad48119f08dc685c4e65e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc64 SHELL=/bin/bash sound/soc/codecs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>


sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/tas27xx.c:234:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
   sound/soc/codecs/tas27xx.c:240:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
   sound/soc/codecs/tas27xx.c:246:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
>> sound/soc/codecs/tas27xx.c:334:58: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int bitwidth @@     got restricted snd_pcm_format_t @@
   sound/soc/codecs/tas27xx.c:334:58: sparse:     expected int bitwidth
   sound/soc/codecs/tas27xx.c:334:58: sparse:     got restricted snd_pcm_format_t

vim +234 sound/soc/codecs/tas27xx.c

827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  225  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  226  static int tas27xx_set_bitwidth(struct tas27xx_priv *tas27xx, int bitwidth)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  227  {
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  228  	struct snd_soc_component *component = tas27xx->component;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  229  	int sense_en;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  230  	int val;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  231  	int ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  232  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  233  	switch (bitwidth) {
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07 @234  	case SNDRV_PCM_FORMAT_S16_LE:
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  235  		ret = snd_soc_component_update_bits(component,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  236  					TAS27XX_TDM_CFG2,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  237  					TAS27XX_TDM_CFG2_RXW_MASK,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  238  					TAS27XX_TDM_CFG2_RXW_16BITS);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  239  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  240  	case SNDRV_PCM_FORMAT_S24_LE:
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  241  		ret = snd_soc_component_update_bits(component,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  242  					TAS27XX_TDM_CFG2,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  243  					TAS27XX_TDM_CFG2_RXW_MASK,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  244  					TAS27XX_TDM_CFG2_RXW_24BITS);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  245  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  246  	case SNDRV_PCM_FORMAT_S32_LE:
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  247  		ret = snd_soc_component_update_bits(component,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  248  					TAS27XX_TDM_CFG2,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  249  					TAS27XX_TDM_CFG2_RXW_MASK,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  250  					TAS27XX_TDM_CFG2_RXW_32BITS);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  251  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  252  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  253  	default:
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  254  		return -EINVAL;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  255  	}
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  256  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  257  	if (ret < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  258  		return ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  259  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  260  	val = snd_soc_component_read(tas27xx->component, TAS27XX_PWR_CTRL);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  261  	if (val < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  262  		return val;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  263  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  264  	if (val & (1 << TAS27XX_VSENSE_POWER_EN))
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  265  		sense_en = 0;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  266  	else
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  267  		sense_en = TAS27XX_TDM_CFG5_VSNS_ENABLE;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  268  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  269  	ret = snd_soc_component_update_bits(tas27xx->component,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  270  		TAS27XX_TDM_CFG5, TAS27XX_TDM_CFG5_VSNS_ENABLE, sense_en);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  271  	if (ret < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  272  		return ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  273  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  274  	if (val & (1 << TAS27XX_ISENSE_POWER_EN))
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  275  		sense_en = 0;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  276  	else
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  277  		sense_en = TAS27XX_TDM_CFG6_ISNS_ENABLE;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  278  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  279  	ret = snd_soc_component_update_bits(tas27xx->component,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  280  		TAS27XX_TDM_CFG6, TAS27XX_TDM_CFG6_ISNS_ENABLE, sense_en);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  281  	if (ret < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  282  		return ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  283  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  284  	return 0;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  285  }
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  286  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  287  static int tas27xx_set_samplerate(
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  288  	struct tas27xx_priv *tas27xx, int samplerate)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  289  {
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  290  	struct snd_soc_component *component = tas27xx->component;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  291  	int ramp_rate_val;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  292  	int ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  293  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  294  	switch (samplerate) {
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  295  	case 48000:
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  296  		ramp_rate_val = TAS27XX_TDM_CFG0_SMP_48KHZ |
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  297  				TAS27XX_TDM_CFG0_44_1_48KHZ;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  298  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  299  	case 44100:
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  300  		ramp_rate_val = TAS27XX_TDM_CFG0_SMP_44_1KHZ |
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  301  				TAS27XX_TDM_CFG0_44_1_48KHZ;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  302  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  303  	case 96000:
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  304  		ramp_rate_val = TAS27XX_TDM_CFG0_SMP_48KHZ |
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  305  				TAS27XX_TDM_CFG0_88_2_96KHZ;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  306  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  307  	case 88200:
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  308  		ramp_rate_val = TAS27XX_TDM_CFG0_SMP_44_1KHZ |
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  309  				TAS27XX_TDM_CFG0_88_2_96KHZ;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  310  		break;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  311  	default:
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  312  		return -EINVAL;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  313  	}
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  314  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  315  	ret = snd_soc_component_update_bits(component, TAS27XX_TDM_CFG0,
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  316  					    TAS27XX_TDM_CFG0_SMP_MASK |
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  317  					    TAS27XX_TDM_CFG0_MASK,
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  318  					    ramp_rate_val);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  319  	if (ret < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  320  		return ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  321  
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  322  	return 0;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  323  }
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  324  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  325  static int tas27xx_hw_params(struct snd_pcm_substream *substream,
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  326  			     struct snd_pcm_hw_params *params,
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  327  			     struct snd_soc_dai *dai)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  328  {
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  329  	struct snd_soc_component *component = dai->component;
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  330  	struct tas27xx_priv *tas27xx =
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  331  		snd_soc_component_get_drvdata(component);
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  332  	int ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  333  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09 @334  	ret = tas27xx_set_bitwidth(tas27xx, params_format(params));
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  335  	if (ret < 0)
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  336  		return ret;
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  337  
a593d3d588870a sound/soc/codecs/tas27xx.c Raphael-Xu 2022-04-09  338  	return tas27xx_set_samplerate(tas27xx, params_rate(params));
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  339  }
827ed8a0fa50bd sound/soc/codecs/tas2764.c Dan Murphy 2020-10-07  340  

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


More information about the Alsa-devel mailing list