public inbox for oe-kbuild@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: [broonie-misc:asoc-7.1 9/26] sound/soc/fsl/fsl_easrc.c:57:22: sparse: sparse: unsigned value that used to be signed checked against zero?
Date: Fri, 03 Apr 2026 16:43:14 +0800	[thread overview]
Message-ID: <202604030438.omM2s8Vm-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check warning: sound/soc/fsl/fsl_easrc.c:57:22: sparse: sparse: unsigned value that used to be signed checked against zero?"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Shengjiu Wang <shengjiu.wang@nxp.com>
CC: Mark Brown <broonie@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git asoc-7.1
head:   e8f504c790103a3221a2f2082704b9f2245d81e8
commit: 00541b86fb578d4949cfdd6aff1f82d43fcf07af [9/26] ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
:::::: branch date: 5 hours ago
:::::: commit date: 27 hours ago
config: csky-randconfig-r121-20260402 (https://download.01.org/0day-ci/archive/20260403/202604030438.omM2s8Vm-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 10.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260403/202604030438.omM2s8Vm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202604030438.omM2s8Vm-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> sound/soc/fsl/fsl_easrc.c:57:22: sparse: sparse: unsigned value that used to be signed checked against zero?
   sound/soc/fsl/fsl_easrc.c:54:31: sparse: signed value source

vim +57 sound/soc/fsl/fsl_easrc.c

955ac624058f91 Shengjiu Wang 2020-04-16  33  
955ac624058f91 Shengjiu Wang 2020-04-16  34  #define FSL_EASRC_FORMATS       (SNDRV_PCM_FMTBIT_S16_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  35  				 SNDRV_PCM_FMTBIT_U16_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  36  				 SNDRV_PCM_FMTBIT_S24_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  37  				 SNDRV_PCM_FMTBIT_S24_3LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  38  				 SNDRV_PCM_FMTBIT_U24_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  39  				 SNDRV_PCM_FMTBIT_U24_3LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  40  				 SNDRV_PCM_FMTBIT_S32_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  41  				 SNDRV_PCM_FMTBIT_U32_LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  42  				 SNDRV_PCM_FMTBIT_S20_3LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  43  				 SNDRV_PCM_FMTBIT_U20_3LE | \
955ac624058f91 Shengjiu Wang 2020-04-16  44  				 SNDRV_PCM_FMTBIT_FLOAT_LE)
955ac624058f91 Shengjiu Wang 2020-04-16  45  
955ac624058f91 Shengjiu Wang 2020-04-16  46  static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
955ac624058f91 Shengjiu Wang 2020-04-16  47  				     struct snd_ctl_elem_value *ucontrol)
955ac624058f91 Shengjiu Wang 2020-04-16  48  {
955ac624058f91 Shengjiu Wang 2020-04-16  49  	struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol);
955ac624058f91 Shengjiu Wang 2020-04-16  50  	struct fsl_asrc *easrc = snd_soc_component_get_drvdata(comp);
955ac624058f91 Shengjiu Wang 2020-04-16  51  	struct fsl_easrc_priv *easrc_priv = easrc->private;
955ac624058f91 Shengjiu Wang 2020-04-16  52  	struct soc_mreg_control *mc =
955ac624058f91 Shengjiu Wang 2020-04-16  53  		(struct soc_mreg_control *)kcontrol->private_value;
955ac624058f91 Shengjiu Wang 2020-04-16  54  	unsigned int regval = ucontrol->value.integer.value[0];
54a86cf48eaa6d Mark Brown    2026-02-05  55  	int ret;
54a86cf48eaa6d Mark Brown    2026-02-05  56  
00541b86fb578d Shengjiu Wang 2026-04-01 @57  	if (regval < EASRC_WIDTH_16_BIT || regval > EASRC_WIDTH_24_BIT)
00541b86fb578d Shengjiu Wang 2026-04-01  58  		return -EINVAL;
00541b86fb578d Shengjiu Wang 2026-04-01  59  
54a86cf48eaa6d Mark Brown    2026-02-05  60  	ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
955ac624058f91 Shengjiu Wang 2020-04-16  61  
955ac624058f91 Shengjiu Wang 2020-04-16  62  	easrc_priv->bps_iec958[mc->regbase] = regval;
955ac624058f91 Shengjiu Wang 2020-04-16  63  
54a86cf48eaa6d Mark Brown    2026-02-05  64  	return ret;
955ac624058f91 Shengjiu Wang 2020-04-16  65  }
955ac624058f91 Shengjiu Wang 2020-04-16  66  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-04-03  8:43 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=202604030438.omM2s8Vm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox