public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32
@ 2021-11-19 20:00 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-19 20:00 UTC (permalink / raw)
  To: Noralf Trønnes; +Cc: kbuild-all, linux-kernel, Peter Stuge

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4c388a8e740d3235a194f330c8ef327deef710f6
commit: 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 drm: Add GUD USB Display driver
date:   8 months ago
config: mips-randconfig-s032-20211116 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 11.2.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-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=40e1a70b4aedf2859a1829991b48ef0ebe650bf2
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 40e1a70b4aedf2859a1829991b48ef0ebe650bf2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/ block// drivers/ kernel// net/

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 >>)
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
>> drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32
>> drivers/gpu/drm/gud/gud_drv.c:95:17: sparse: sparse: restricted __le32 degrades to integer

vim +95 drivers/gpu/drm/gud/gud_drv.c

    76	
    77	static int gud_get_display_descriptor(struct usb_interface *intf,
    78					      struct gud_display_descriptor_req *desc)
    79	{
    80		void *buf;
    81		int ret;
    82	
    83		buf = kmalloc(sizeof(*desc), GFP_KERNEL);
    84		if (!buf)
    85			return -ENOMEM;
    86	
    87		ret = gud_usb_control_msg(intf, true, GUD_REQ_GET_DESCRIPTOR, 0, buf, sizeof(*desc));
    88		memcpy(desc, buf, sizeof(*desc));
    89		kfree(buf);
    90		if (ret < 0)
    91			return ret;
    92		if (ret != sizeof(*desc))
    93			return -EIO;
    94	
  > 95		if (desc->magic != le32_to_cpu(GUD_DISPLAY_MAGIC))
    96			return -ENODATA;
    97	
    98		DRM_DEV_DEBUG_DRIVER(&intf->dev,
    99				     "version=%u flags=0x%x compression=0x%x max_buffer_size=%u\n",
   100				     desc->version, le32_to_cpu(desc->flags), desc->compression,
   101				     le32_to_cpu(desc->max_buffer_size));
   102	
   103		if (!desc->version || !desc->max_width || !desc->max_height ||
   104		    le32_to_cpu(desc->min_width) > le32_to_cpu(desc->max_width) ||
   105		    le32_to_cpu(desc->min_height) > le32_to_cpu(desc->max_height))
   106			return -EINVAL;
   107	
   108		return 0;
   109	}
   110	

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

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

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

* drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32
@ 2023-11-11 12:55 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-11-11 12:55 UTC (permalink / raw)
  To: Noralf Trønnes; +Cc: oe-kbuild-all, linux-kernel, Peter Stuge

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3ca112b71f35dd5d99fc4571a56b5fc6f0c15814
commit: 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 drm: Add GUD USB Display driver
date:   2 years, 8 months ago
config: i386-randconfig-062-20230912 (https://download.01.org/0day-ci/archive/20231111/202311112013.3oeb6fZG-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231111/202311112013.3oeb6fZG-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/oe-kbuild-all/202311112013.3oeb6fZG-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32
>> drivers/gpu/drm/gud/gud_drv.c:95:17: sparse: sparse: restricted __le32 degrades to integer

vim +95 drivers/gpu/drm/gud/gud_drv.c

    76	
    77	static int gud_get_display_descriptor(struct usb_interface *intf,
    78					      struct gud_display_descriptor_req *desc)
    79	{
    80		void *buf;
    81		int ret;
    82	
    83		buf = kmalloc(sizeof(*desc), GFP_KERNEL);
    84		if (!buf)
    85			return -ENOMEM;
    86	
    87		ret = gud_usb_control_msg(intf, true, GUD_REQ_GET_DESCRIPTOR, 0, buf, sizeof(*desc));
    88		memcpy(desc, buf, sizeof(*desc));
    89		kfree(buf);
    90		if (ret < 0)
    91			return ret;
    92		if (ret != sizeof(*desc))
    93			return -EIO;
    94	
  > 95		if (desc->magic != le32_to_cpu(GUD_DISPLAY_MAGIC))
    96			return -ENODATA;
    97	
    98		DRM_DEV_DEBUG_DRIVER(&intf->dev,
    99				     "version=%u flags=0x%x compression=0x%x max_buffer_size=%u\n",
   100				     desc->version, le32_to_cpu(desc->flags), desc->compression,
   101				     le32_to_cpu(desc->max_buffer_size));
   102	
   103		if (!desc->version || !desc->max_width || !desc->max_height ||
   104		    le32_to_cpu(desc->min_width) > le32_to_cpu(desc->max_width) ||
   105		    le32_to_cpu(desc->min_height) > le32_to_cpu(desc->max_height))
   106			return -EINVAL;
   107	
   108		return 0;
   109	}
   110	

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

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

end of thread, other threads:[~2023-11-11 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-11 12:55 drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-11-19 20:00 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox