linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Peter Stuge <peter@stuge.se>
Subject: [linux-next:master 3792/7299] drivers/gpu/drm/gud/gud_drv.c:95:28: sparse: sparse: cast to restricted __le32
Date: Fri, 26 Mar 2021 08:07:40 +0800	[thread overview]
Message-ID: <202103260835.Hz4DZmYf-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b4f20b70784aabf97e1727561e775500f6e294c7
commit: 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 [3792/7299] drm: Add GUD USB Display driver
config: microblaze-randconfig-s031-20210325 (attached as .config)
compiler: microblaze-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=40e1a70b4aedf2859a1829991b48ef0ebe650bf2
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 40e1a70b4aedf2859a1829991b48ef0ebe650bf2
        # 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=microblaze 

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 >>)
>> 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: 25310 bytes --]

                 reply	other threads:[~2021-03-26  0:08 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=202103260835.Hz4DZmYf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=noralf@tronnes.org \
    --cc=peter@stuge.se \
    /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