All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
@ 2023-03-24  0:42 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-03-24  0:42 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: oe-kbuild-all, Samaga Prasanna Krishna, Curtis Malainey

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-s043-20230322 (https://download.01.org/0day-ci/archive/20230324/202303240801.fCzVs0c2-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 drivers/devfreq/event/ fs/ net/bluetooth/ sound/core/ sound/pci/hda/ 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/202303240801.fCzVs0c2-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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [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
@ 2023-04-22 15:05 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-04-22 15:05 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: oe-kbuild-all, Samaga Prasanna Krishna, Curtis Malainey

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-22 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-04-22 15:05 kernel test robot

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.