All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [plbossart-sound:sdw/auxiliary-bus-take2 3900/3904] sound/soc/sof/topology.c:3338:34: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 26 Mar 2021 06:05:12 +0800	[thread overview]
Message-ID: <202103260607.11EUAvFA-lkp@intel.com> (raw)

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

tree:   https://github.com/plbossart/sound sdw/auxiliary-bus-take2
head:   41a68efa3feffd446ee29551f5ff888428e6c2c5
commit: 91c06bb464000241183ebfedab325fb51fed67ba [3900/3904] ASoC: SOF: parse multiple SSP DAI and hw configs
config: parisc-randconfig-s031-20210325 (attached as .config)
compiler: hppa-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-277-gc089cd2d-dirty
        # https://github.com/plbossart/sound/commit/91c06bb464000241183ebfedab325fb51fed67ba
        git remote add plbossart-sound https://github.com/plbossart/sound
        git fetch --no-tags plbossart-sound sdw/auxiliary-bus-take2
        git checkout 91c06bb464000241183ebfedab325fb51fed67ba
        # 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=parisc 

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


sparse warnings: (new ones prefixed by >>)
>> sound/soc/sof/topology.c:3338:34: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] format @@     got restricted __le32 [usertype] fmt @@
   sound/soc/sof/topology.c:3338:34: sparse:     expected unsigned short [usertype] format
   sound/soc/sof/topology.c:3338:34: sparse:     got restricted __le32 [usertype] fmt

vim +3338 sound/soc/sof/topology.c

  3239	
  3240	/* DAI link - used for any driver specific init */
  3241	static int sof_link_load(struct snd_soc_component *scomp, int index,
  3242				 struct snd_soc_dai_link *link,
  3243				 struct snd_soc_tplg_link_config *cfg)
  3244	{
  3245		struct snd_soc_tplg_private *private = &cfg->priv;
  3246		struct snd_soc_tplg_hw_config *hw_config;
  3247		struct sof_ipc_dai_config common_config;
  3248		struct sof_ipc_dai_config *config;
  3249		int curr_conf;
  3250		int num_conf;
  3251		int ret;
  3252		int i;
  3253	
  3254		if (!link->platforms) {
  3255			dev_err(scomp->dev, "error: no platforms\n");
  3256			return -EINVAL;
  3257		}
  3258		link->platforms->name = dev_name(scomp->dev);
  3259	
  3260		/*
  3261		 * Set nonatomic property for FE dai links as their trigger action
  3262		 * involves IPC's.
  3263		 */
  3264		if (!link->no_pcm) {
  3265			link->nonatomic = true;
  3266	
  3267			/*
  3268			 * set default trigger order for all links. Exceptions to
  3269			 * the rule will be handled in sof_pcm_dai_link_fixup()
  3270			 * For playback, the sequence is the following: start FE,
  3271			 * start BE, stop BE, stop FE; for Capture the sequence is
  3272			 * inverted start BE, start FE, stop FE, stop BE
  3273			 */
  3274			link->trigger[SNDRV_PCM_STREAM_PLAYBACK] =
  3275						SND_SOC_DPCM_TRIGGER_PRE;
  3276			link->trigger[SNDRV_PCM_STREAM_CAPTURE] =
  3277						SND_SOC_DPCM_TRIGGER_POST;
  3278	
  3279			/* nothing more to do for FE dai links */
  3280			return 0;
  3281		}
  3282	
  3283		/* check we have some tokens - we need at least DAI type */
  3284		if (le32_to_cpu(private->size) == 0) {
  3285			dev_err(scomp->dev, "error: expected tokens for DAI, none found\n");
  3286			return -EINVAL;
  3287		}
  3288	
  3289		memset(&common_config, 0, sizeof(common_config));
  3290	
  3291		/* get any common DAI tokens */
  3292		ret = sof_parse_tokens(scomp, &common_config, dai_link_tokens, ARRAY_SIZE(dai_link_tokens),
  3293				       private->array, le32_to_cpu(private->size));
  3294		if (ret != 0) {
  3295			dev_err(scomp->dev, "error: parse link tokens failed %d\n",
  3296				le32_to_cpu(private->size));
  3297			return ret;
  3298		}
  3299	
  3300		/*
  3301		 * DAI links are expected to have at least 1 hw_config.
  3302		 * But some older topologies might have no hw_config for HDA dai links.
  3303		 */
  3304		hw_config = cfg->hw_config;
  3305		num_conf = le32_to_cpu(cfg->num_hw_configs);
  3306		if (!num_conf) {
  3307			if (common_config.type != SOF_DAI_INTEL_HDA) {
  3308				dev_err(scomp->dev, "error: unexpected DAI config count %d!\n",
  3309					le32_to_cpu(cfg->num_hw_configs));
  3310				return -EINVAL;
  3311			}
  3312			num_conf = 1;
  3313			curr_conf = 0;
  3314		} else {
  3315			dev_dbg(scomp->dev, "tplg: %d hw_configs found, default id: %d!\n",
  3316				cfg->num_hw_configs, le32_to_cpu(cfg->default_hw_config_id));
  3317	
  3318			for (curr_conf = 0; curr_conf < num_conf; curr_conf++) {
  3319				if (hw_config[curr_conf].id == cfg->default_hw_config_id)
  3320					break;
  3321			}
  3322	
  3323			if (curr_conf == num_conf) {
  3324				dev_err(scomp->dev, "error: default hw_config id: %d not found!\n",
  3325					le32_to_cpu(cfg->default_hw_config_id));
  3326				return -EINVAL;
  3327			}
  3328		}
  3329	
  3330		/* Reserve memory for all hw configs, eventually freed by widget */
  3331		config = kcalloc(num_conf, sizeof(*config), GFP_KERNEL);
  3332		if (!config)
  3333			return -ENOMEM;
  3334	
  3335		/* Copy common data to all config ipc structs */
  3336		for (i = 0; i < num_conf; i++) {
  3337			config[i].hdr.cmd = SOF_IPC_GLB_DAI_MSG | SOF_IPC_DAI_CONFIG;
> 3338			config[i].format = hw_config[i].fmt;
  3339			config[i].type = common_config.type;
  3340			config[i].dai_index = common_config.dai_index;
  3341		}
  3342	
  3343		/* now load DAI specific data and send IPC - type comes from token */
  3344		switch (common_config.type) {
  3345		case SOF_DAI_INTEL_SSP:
  3346			ret = sof_link_ssp_load(scomp, index, link, cfg, hw_config, config, curr_conf);
  3347			break;
  3348		case SOF_DAI_INTEL_DMIC:
  3349			ret = sof_link_dmic_load(scomp, index, link, cfg, hw_config + curr_conf, config);
  3350			break;
  3351		case SOF_DAI_INTEL_HDA:
  3352			ret = sof_link_hda_load(scomp, index, link, cfg, hw_config + curr_conf, config);
  3353			break;
  3354		case SOF_DAI_INTEL_ALH:
  3355			ret = sof_link_alh_load(scomp, index, link, cfg, hw_config + curr_conf, config);
  3356			break;
  3357		case SOF_DAI_IMX_SAI:
  3358			ret = sof_link_sai_load(scomp, index, link, cfg, hw_config + curr_conf, config);
  3359			break;
  3360		case SOF_DAI_IMX_ESAI:
  3361			ret = sof_link_esai_load(scomp, index, link, cfg, hw_config + curr_conf, config);
  3362			break;
  3363		default:
  3364			dev_err(scomp->dev, "error: invalid DAI type %d\n", common_config.type);
  3365			ret = -EINVAL;
  3366			break;
  3367		}
  3368	
  3369		kfree(config);
  3370	
  3371		return ret;
  3372	}
  3373	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33433 bytes --]

                 reply	other threads:[~2021-03-25 22:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202103260607.11EUAvFA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.