[PATCH v6] drm/ioctl: Add a ioctl to set and get a label on GEM objects

kbuild test robot lkp at intel.com
Sun May 31 03:03:03 UTC 2020


Hi Rohan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-exynos/exynos-drm-next]
[also build test WARNING on drm-intel/for-linux-next tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Rohan-Garg/drm-ioctl-Add-a-ioctl-to-set-and-get-a-label-on-GEM-objects/20200531-000134
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
config: x86_64-randconfig-s021-20200531 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-243-gc100a7ab-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp at intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/drm_gem.c:974:24: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected char *label @@     got char const *label @@
>> drivers/gpu/drm/drm_gem.c:974:24: sparse:     expected char *label
>> drivers/gpu/drm/drm_gem.c:974:24: sparse:     got char const *label
>> drivers/gpu/drm/drm_gem.c:992:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] label @@     got void * @@
>> drivers/gpu/drm/drm_gem.c:992:29: sparse:     expected unsigned long long [usertype] label
>> drivers/gpu/drm/drm_gem.c:992:29: sparse:     got void *
>> drivers/gpu/drm/drm_gem.c:1000:28: sparse: sparse: incompatible types in comparison expression (different signedness):
>> drivers/gpu/drm/drm_gem.c:1000:28: sparse:    unsigned int *
>> drivers/gpu/drm/drm_gem.c:1000:28: sparse:    int *
--
>> drivers/gpu/drm/drm_ioctl.c:636:46: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got char * @@
>> drivers/gpu/drm/drm_ioctl.c:636:46: sparse:     expected int
>> drivers/gpu/drm/drm_ioctl.c:636:46: sparse:     got char *
>> drivers/gpu/drm/drm_ioctl.c:636:24: sparse: sparse: non size-preserving pointer to integer cast

vim +974 drivers/gpu/drm/drm_gem.c

   969	
   970	void drm_gem_adopt_label(struct drm_gem_object *gem_obj, const char *label)
   971	{
   972		mutex_lock(&gem_obj->bo_lock);
   973		kfree(gem_obj->label);
 > 974		gem_obj->label = label;
   975		mutex_unlock(&gem_obj->bo_lock);
   976	}
   977	EXPORT_SYMBOL(drm_gem_adopt_label);
   978	
   979	int drm_gem_get_label(struct drm_device *dev, struct drm_file *file_priv,
   980			      struct drm_handle_label *args)
   981	{
   982		struct drm_gem_object *gem_obj;
   983		int len, ret;
   984	
   985		gem_obj = drm_gem_object_lookup(file_priv, args->handle);
   986		if (!gem_obj) {
   987			DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
   988			return -ENOENT;
   989		}
   990	
   991		if (!gem_obj->label) {
 > 992			args->label = NULL;
   993			args->len = 0;
   994			return 0;
   995		}
   996	
   997		mutex_lock(&gem_obj->bo_lock);
   998		len = strlen(gem_obj->label);
   999		ret = copy_to_user(u64_to_user_ptr(args->label), gem_obj->label,
> 1000				   min(args->len, len));
  1001		mutex_unlock(&gem_obj->bo_lock);
  1002		args->len = len;
  1003		drm_gem_object_put(gem_obj);
  1004		return ret;
  1005	}
  1006	EXPORT_SYMBOL(drm_gem_get_label);
  1007	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36196 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200531/e93834c6/attachment-0001.gz>


More information about the dri-devel mailing list