Re: [PATCH] ona10iv: add ona10iv smart PA kernel driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jamie,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.10-rc3 next-20201113]
[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/0day-ci/linux/commits/Jamie-Meacham/ona10iv-add-ona10iv-smart-PA-kernel-driver/20201105-004426
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-randconfig-s031-20201113 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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.3-107-gaf3512a6-dirty
        # https://github.com/0day-ci/linux/commit/f91836c114d9be24432bbe5e0a968ebd8156a1c1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jamie-Meacham/ona10iv-add-ona10iv-smart-PA-kernel-driver/20201105-004426
        git checkout f91836c114d9be24432bbe5e0a968ebd8156a1c1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
>> sound/soc/codecs/ona10iv.c:256:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
   sound/soc/codecs/ona10iv.c:260:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
   sound/soc/codecs/ona10iv.c:264:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
   sound/soc/codecs/ona10iv.c:265:14: sparse: sparse: restricted snd_pcm_format_t degrades to integer
>> sound/soc/codecs/ona10iv.c:355:58: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int format @@     got restricted snd_pcm_format_t @@
>> sound/soc/codecs/ona10iv.c:355:58: sparse:     expected int format
>> sound/soc/codecs/ona10iv.c:355:58: sparse:     got restricted snd_pcm_format_t
>> sound/soc/codecs/ona10iv.c:358:46: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected int param_val @@     got restricted snd_pcm_format_t @@
>> sound/soc/codecs/ona10iv.c:358:46: sparse:     expected int param_val
   sound/soc/codecs/ona10iv.c:358:46: sparse:     got restricted snd_pcm_format_t

vim +256 sound/soc/codecs/ona10iv.c

   245	
   246	static int ona10iv_set_bitwidth(struct ona10iv_priv *ona10iv, int format)
   247	{
   248		struct snd_soc_component *component = ona10iv->component;
   249		int slot_width, sample_width;
   250		int ret = 0;
   251	
   252		dev_dbg(component->dev,
   253				"ONA10IV-->set bitwidth for format: %d\n", format);
   254	
   255		switch (format) {
 > 256		case SNDRV_PCM_FORMAT_S16_LE:
   257			sample_width = ONA10IV_SAMPW_16;
   258			slot_width = ONA10IV_SLOTW_16;
   259			break;
   260		case SNDRV_PCM_FORMAT_S24_3LE:
   261			sample_width = ONA10IV_SAMPW_24;
   262			slot_width = ONA10IV_SLOTW_24;
   263			break;
   264		case SNDRV_PCM_FORMAT_S24_LE:
   265		case SNDRV_PCM_FORMAT_S32_LE:
   266			sample_width = ONA10IV_SAMPW_32;
   267			slot_width = ONA10IV_SLOTW_32;
   268			break;
   269		default:
   270			ret = -EINVAL;
   271		}
   272		param_errcheck(ret, component->dev,
   273					"error no case match for format", format);
   274	
   275		if (ret < 0)
   276			return ret;
   277	
   278		ret = snd_soc_component_update_bits(component,
   279					ONA10IV_REG_DAI_CTRL2, ONA10IV_SAMPW_MASK,
   280					sample_width);
   281		param_errcheck(ret, component->dev,
   282					"error writing sample width", sample_width);
   283		if (ret < 0)
   284			return ret;
   285	
   286		ret = snd_soc_component_update_bits(component,
   287					ONA10IV_REG_DAI_CTRL2, ONA10IV_SLOTW_MASK,
   288					slot_width);
   289		param_errcheck(ret, component->dev,
   290					"error writing slot width", slot_width);
   291		if (ret < 0)
   292			return ret;
   293	
   294		return 0;
   295	}
   296	
   297	static int ona10iv_set_samplerate(struct ona10iv_priv *ona10iv,
   298						int samplerate)
   299	{
   300		struct snd_soc_component *component = ona10iv->component;
   301		int rate_val;
   302		int ret = 0;
   303	
   304		dev_dbg(component->dev, "ONA10IV-->samplerate: %d\n", samplerate);
   305	
   306		switch (samplerate) {
   307		case 16000:
   308			rate_val = ONA10IV_FS_16KHZ;
   309			break;
   310		case 22050:
   311			rate_val = ONA10IV_FS_22KHZ;
   312			break;
   313		case 32000:
   314			rate_val = ONA10IV_FS_32KHZ;
   315			break;
   316		case 44100:
   317			rate_val = ONA10IV_FS_44KHZ;
   318			break;
   319		case 48000:
   320			rate_val = ONA10IV_FS_48KHZ;
   321			break;
   322		case 96000:
   323			rate_val = ONA10IV_FS_96KHZ;
   324			break;
   325		default:
   326			ret = -EINVAL;
   327		}
   328		param_errcheck(ret, component->dev,
   329					"error no case match for rate", samplerate);
   330		if (ret < 0)
   331			return ret;
   332	
   333		ret = snd_soc_component_update_bits(component,
   334					ONA10IV_REG_DAI_CTRL1, ONA10IV_FS_MASK,
   335					rate_val);
   336		param_errcheck(ret, component->dev,
   337					"error writing rate", rate_val);
   338		if (ret < 0)
   339			return ret;
   340	
   341		return 0;
   342	}
   343	
   344	static int ona10iv_hw_params(struct snd_pcm_substream *substream,
   345					 struct snd_pcm_hw_params *params,
   346					 struct snd_soc_dai *dai)
   347	{
   348		struct snd_soc_component *component = dai->component;
   349		struct ona10iv_priv *ona10iv =
   350					snd_soc_component_get_drvdata(component);
   351		int ret;
   352	
   353		dev_dbg(component->dev, "ONA10IV-->setting hw params\n");
   354	
 > 355		ret = ona10iv_set_bitwidth(ona10iv, params_format(params));
   356		param_errcheck(ret, component->dev,
   357					"error setting bitwidth for format",
 > 358					params_format(params));
   359		if (ret)
   360			return ret;
   361	
   362		ret = ona10iv_set_samplerate(ona10iv, params_rate(params));
   363		param_errcheck(ret, component->dev,
   364					"error setting rate", params_rate(params));
   365		if (ret)
   366			return ret;
   367	
   368		return 0;
   369	}
   370	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux