oe-kbuild-all.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Samaga Prasanna Krishna
	<samaga.krishna@intel.corp-partner.google.com>,
	Curtis Malainey <cujomalainey@chromium.org>
Subject: [jsarha:topic/cros-sof-v4.14-rebase 3569/9999] sound/soc/sof/debug.c:57:9: sparse: sparse: cast removes address space '<asn:2>' of expression
Date: Sat, 22 Apr 2023 23:05:59 +0800	[thread overview]
Message-ID: <202304222205.9kDe1nRD-lkp@intel.com> (raw)

tree:   https://github.com/jsarha/linux topic/cros-sof-v4.14-rebase
head:   18a233f3f676a98dde00947535d99ab1a54da340
commit: 71198ee91e6191cab28765e80aa3bb7e6b41d34a [3569/9999] CHROMIUM: ASoC: SOF: core fix sparse warnings.
config: m68k-randconfig-s051-20230416 (https://download.01.org/0day-ci/archive/20230422/202304222205.9kDe1nRD-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 7.5.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-39-gce1a6720-dirty
        # https://github.com/jsarha/linux/commit/71198ee91e6191cab28765e80aa3bb7e6b41d34a
        git remote add jsarha https://github.com/jsarha/linux
        git fetch --no-tags jsarha topic/cros-sof-v4.14-rebase
        git checkout 71198ee91e6191cab28765e80aa3bb7e6b41d34a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash sound/soc/codecs/ sound/soc/sof/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304222205.9kDe1nRD-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> sound/soc/sof/debug.c:57:9: sparse: sparse: cast removes address space '<asn:2>' of expression

vim +57 sound/soc/sof/debug.c

ed1d2896fb2fa3 Liam Girdwood 2018-01-08  31  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  32  static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  33  				 size_t count, loff_t *ppos)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  34  {
71198ee91e6191 Liam Girdwood 2018-07-05  35  	struct snd_sof_dfsentry_io *dfse = file->private_data;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  36  	struct snd_sof_dev *sdev = dfse->sdev;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  37  	int size;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  38  	u32 *buf;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  39  	loff_t pos = *ppos;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  40  	size_t ret;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  41  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  42  	size = dfse->size;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  43  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  44  	if (pos < 0)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  45  		return -EINVAL;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  46  	if (pos >= size || !count)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  47  		return 0;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  48  	if (count > size - pos)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  49  		count = size - pos;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  50  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  51  	size = (count + 3) & ~3;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  52  	buf = kzalloc(size, GFP_KERNEL);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  53  	if (!buf)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  54  		return -ENOMEM;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  55  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  56  	pm_runtime_get(sdev->dev);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08 @57  	memcpy_fromio(buf,  dfse->buf + pos, size);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  58  	pm_runtime_put(sdev->dev);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  59  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  60  	ret = copy_to_user(buffer, buf, count);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  61  	kfree(buf);
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  62  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  63  	if (ret == count)
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  64  		return -EFAULT;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  65  	count -= ret;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  66  	*ppos = pos + count;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  67  
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  68  	return count;
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  69  }
ed1d2896fb2fa3 Liam Girdwood 2018-01-08  70  

:::::: The code at line 57 was first introduced by commit
:::::: ed1d2896fb2fa34d1efe8606af4bcee59afe807e FROMLIST: ASoC: SOF: Add driver debug support.

:::::: TO: Liam Girdwood <liam.r.girdwood@linux.intel.com>
:::::: CC: chrome-bot <chrome-bot@chromium.org>

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

             reply	other threads:[~2023-04-22 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-22 15:05 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-24  0:42 [jsarha:topic/cros-sof-v4.14-rebase 3569/9999] sound/soc/sof/debug.c:57:9: sparse: sparse: cast removes address space '<asn:2>' of expression kernel test robot

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=202304222205.9kDe1nRD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cujomalainey@chromium.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=samaga.krishna@intel.corp-partner.google.com \
    /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;
as well as URLs for NNTP newsgroup(s).