[drm-intel:drm-intel-gt-next 1/1] drivers/gpu/drm/i915/i915_query.c:439:2: warning: comparison of integers of different signs: 'int' and 'unsigned int'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://anongit.freedesktop.org/drm-intel drm-intel-gt-next
head:   d5ef86b38e4c2a65d5c1d64d8d0f3fcf58aa0884
commit: d5ef86b38e4c2a65d5c1d64d8d0f3fcf58aa0884 [1/1] drm/i915: Add pci ids and uapi for DG1
config: i386-randconfig-r002-20210903 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 1104e3258b5064e7110cc297e2cec60ac9acfc0a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git remote add drm-intel git://anongit.freedesktop.org/drm-intel
        git fetch --no-tags drm-intel drm-intel-gt-next
        git checkout d5ef86b38e4c2a65d5c1d64d8d0f3fcf58aa0884
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   include/linux/random.h:127:67: warning: unused parameter 'v' [-Wunused-parameter]
   static inline bool __must_check arch_get_random_int(unsigned int *v)
                                                                     ^
   include/linux/random.h:131:74: warning: unused parameter 'v' [-Wunused-parameter]
   static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
                                                                            ^
   include/linux/random.h:135:72: warning: unused parameter 'v' [-Wunused-parameter]
   static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
                                                                          ^
   In file included from drivers/gpu/drm/i915/i915_query.c:9:
   In file included from drivers/gpu/drm/i915/i915_drv.h:84:
   In file included from drivers/gpu/drm/i915/gt/intel_engine.h:17:
   In file included from drivers/gpu/drm/i915/gt/intel_gt_types.h:18:
   In file included from drivers/gpu/drm/i915/gt/uc/intel_uc.h:9:
   drivers/gpu/drm/i915/gt/uc/intel_guc.h:180:59: warning: unused parameter 'guc' [-Wunused-parameter]
   static inline u32 intel_guc_ggtt_offset(struct intel_guc *guc,
                                                             ^
   In file included from drivers/gpu/drm/i915/i915_query.c:9:
   In file included from drivers/gpu/drm/i915/i915_drv.h:101:
   drivers/gpu/drm/i915/i915_gpu_error.h:276:43: warning: unused parameter 'gt' [-Wunused-parameter]
   i915_capture_error_state(struct intel_gt *gt, intel_engine_mask_t engine_mask)
                                             ^
   drivers/gpu/drm/i915/i915_gpu_error.h:276:67: warning: unused parameter 'engine_mask' [-Wunused-parameter]
   i915_capture_error_state(struct intel_gt *gt, intel_engine_mask_t engine_mask)
                                                                     ^
   drivers/gpu/drm/i915/i915_gpu_error.h:281:50: warning: unused parameter 'i915' [-Wunused-parameter]
   i915_gpu_coredump_alloc(struct drm_i915_private *i915, gfp_t gfp)
                                                    ^
   drivers/gpu/drm/i915/i915_gpu_error.h:281:62: warning: unused parameter 'gfp' [-Wunused-parameter]
   i915_gpu_coredump_alloc(struct drm_i915_private *i915, gfp_t gfp)
                                                                ^
   drivers/gpu/drm/i915/i915_gpu_error.h:287:42: warning: unused parameter 'gt' [-Wunused-parameter]
   intel_gt_coredump_alloc(struct intel_gt *gt, gfp_t gfp)
                                            ^
   drivers/gpu/drm/i915/i915_gpu_error.h:287:52: warning: unused parameter 'gfp' [-Wunused-parameter]
   intel_gt_coredump_alloc(struct intel_gt *gt, gfp_t gfp)
                                                      ^
   drivers/gpu/drm/i915/i915_gpu_error.h:293:53: warning: unused parameter 'engine' [-Wunused-parameter]
   intel_engine_coredump_alloc(struct intel_engine_cs *engine, gfp_t gfp)
                                                       ^
   drivers/gpu/drm/i915/i915_gpu_error.h:293:67: warning: unused parameter 'gfp' [-Wunused-parameter]
   intel_engine_coredump_alloc(struct intel_engine_cs *engine, gfp_t gfp)
                                                                     ^
   drivers/gpu/drm/i915/i915_gpu_error.h:299:65: warning: unused parameter 'ee' [-Wunused-parameter]
   intel_engine_coredump_add_request(struct intel_engine_coredump *ee,
                                                                   ^
   drivers/gpu/drm/i915/i915_gpu_error.h:300:28: warning: unused parameter 'rq' [-Wunused-parameter]
                                     struct i915_request *rq,
                                                          ^
   drivers/gpu/drm/i915/i915_gpu_error.h:301:13: warning: unused parameter 'gfp' [-Wunused-parameter]
                                     gfp_t gfp)
                                           ^
   drivers/gpu/drm/i915/i915_gpu_error.h:307:61: warning: unused parameter 'ee' [-Wunused-parameter]
   intel_engine_coredump_add_vma(struct intel_engine_coredump *ee,
                                                               ^
   drivers/gpu/drm/i915/i915_gpu_error.h:308:43: warning: unused parameter 'capture' [-Wunused-parameter]
                                 struct intel_engine_capture_vma *capture,
                                                                  ^
   drivers/gpu/drm/i915/i915_gpu_error.h:309:36: warning: unused parameter 'compress' [-Wunused-parameter]
                                 struct i915_vma_compress *compress)
                                                           ^
   drivers/gpu/drm/i915/i915_gpu_error.h:314:52: warning: unused parameter 'gt' [-Wunused-parameter]
   i915_vma_capture_prepare(struct intel_gt_coredump *gt)
                                                      ^
   drivers/gpu/drm/i915/i915_gpu_error.h:320:51: warning: unused parameter 'gt' [-Wunused-parameter]
   i915_vma_capture_finish(struct intel_gt_coredump *gt,
                                                     ^
   drivers/gpu/drm/i915/i915_gpu_error.h:321:30: warning: unused parameter 'compress' [-Wunused-parameter]
                           struct i915_vma_compress *compress)
                                                     ^
   drivers/gpu/drm/i915/i915_gpu_error.h:326:50: warning: unused parameter 'error' [-Wunused-parameter]
   i915_error_state_store(struct i915_gpu_coredump *error)
                                                    ^
   drivers/gpu/drm/i915/i915_gpu_error.h:330:68: warning: unused parameter 'gpu' [-Wunused-parameter]
   static inline void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu)
                                                                      ^
   drivers/gpu/drm/i915/i915_gpu_error.h:335:49: warning: unused parameter 'i915' [-Wunused-parameter]
   i915_first_error_state(struct drm_i915_private *i915)
                                                   ^
   drivers/gpu/drm/i915/i915_gpu_error.h:340:68: warning: unused parameter 'i915' [-Wunused-parameter]
   static inline void i915_reset_error_state(struct drm_i915_private *i915)
                                                                      ^
   drivers/gpu/drm/i915/i915_gpu_error.h:344:70: warning: unused parameter 'i915' [-Wunused-parameter]
   static inline void i915_disable_error_state(struct drm_i915_private *i915,
                                                                        ^
   drivers/gpu/drm/i915/i915_gpu_error.h:345:14: warning: unused parameter 'err' [-Wunused-parameter]
                                               int err)
                                                   ^
   drivers/gpu/drm/i915/i915_query.c:21:25: warning: comparison of integers of different signs: '__s32' (aka 'int') and 'u32' (aka 'unsigned int') [-Wsign-compare]
           if (query_item->length < total_length)
               ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_query.c:143:15: warning: unused parameter 'user_regs_ptr' [-Wunused-parameter]
                                                       u64 user_regs_ptr,
                                                           ^
   drivers/gpu/drm/i915/i915_query.c:216:25: warning: comparison of integers of different signs: '__s32' (aka 'int') and 'u32' (aka 'unsigned int') [-Wsign-compare]
           if (query_item->length < total_size) {
               ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
   drivers/gpu/drm/i915/i915_query.c:384:25: warning: comparison of integers of different signs: '__s32' (aka 'int') and 'size_t' (aka 'unsigned int') [-Wsign-compare]
           if (query_item->length < sizeof_perf_config_list(n_configs)) {
               ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/i915_query.c:439:2: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           for_each_memory_region(mr, i915, id) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/intel_memory_region.h:46:18: note: expanded from macro 'for_each_memory_region'
           for (id = 0; id < ARRAY_SIZE((i915)->mm.regions); id++) \
                        ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_query.c:453:16: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           for (i = 0; i < ARRAY_SIZE(query.rsvd); i++) {
                       ~ ^ ~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_query.c:458:2: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
           for_each_memory_region(mr, i915, id) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/intel_memory_region.h:46:18: note: expanded from macro 'for_each_memory_region'
           for (id = 0; id < ARRAY_SIZE((i915)->mm.regions); id++) \
                        ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_query.c:488:75: warning: unused parameter 'file' [-Wunused-parameter]
   int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
                                                                             ^
   1706 warnings generated.


vim +439 drivers/gpu/drm/i915/i915_query.c

4f6ccc74a85cbb Lionel Landwerlin 2019-10-14  421  
710217292a6111 Abdiel Janulgue   2021-04-29  422  static int query_memregion_info(struct drm_i915_private *i915,
710217292a6111 Abdiel Janulgue   2021-04-29  423  				struct drm_i915_query_item *query_item)
710217292a6111 Abdiel Janulgue   2021-04-29  424  {
710217292a6111 Abdiel Janulgue   2021-04-29  425  	struct drm_i915_query_memory_regions __user *query_ptr =
710217292a6111 Abdiel Janulgue   2021-04-29  426  		u64_to_user_ptr(query_item->data_ptr);
710217292a6111 Abdiel Janulgue   2021-04-29  427  	struct drm_i915_memory_region_info __user *info_ptr =
710217292a6111 Abdiel Janulgue   2021-04-29  428  		&query_ptr->regions[0];
710217292a6111 Abdiel Janulgue   2021-04-29  429  	struct drm_i915_memory_region_info info = { };
710217292a6111 Abdiel Janulgue   2021-04-29  430  	struct drm_i915_query_memory_regions query;
710217292a6111 Abdiel Janulgue   2021-04-29  431  	struct intel_memory_region *mr;
710217292a6111 Abdiel Janulgue   2021-04-29  432  	u32 total_length;
710217292a6111 Abdiel Janulgue   2021-04-29  433  	int ret, id, i;
710217292a6111 Abdiel Janulgue   2021-04-29  434  
710217292a6111 Abdiel Janulgue   2021-04-29  435  	if (query_item->flags != 0)
710217292a6111 Abdiel Janulgue   2021-04-29  436  		return -EINVAL;
710217292a6111 Abdiel Janulgue   2021-04-29  437  
710217292a6111 Abdiel Janulgue   2021-04-29  438  	total_length = sizeof(query);
710217292a6111 Abdiel Janulgue   2021-04-29 @439  	for_each_memory_region(mr, i915, id) {
710217292a6111 Abdiel Janulgue   2021-04-29  440  		if (mr->private)
710217292a6111 Abdiel Janulgue   2021-04-29  441  			continue;
710217292a6111 Abdiel Janulgue   2021-04-29  442  
710217292a6111 Abdiel Janulgue   2021-04-29  443  		total_length += sizeof(info);
710217292a6111 Abdiel Janulgue   2021-04-29  444  	}
710217292a6111 Abdiel Janulgue   2021-04-29  445  
710217292a6111 Abdiel Janulgue   2021-04-29  446  	ret = copy_query_item(&query, sizeof(query), total_length, query_item);
710217292a6111 Abdiel Janulgue   2021-04-29  447  	if (ret != 0)
710217292a6111 Abdiel Janulgue   2021-04-29  448  		return ret;
710217292a6111 Abdiel Janulgue   2021-04-29  449  
710217292a6111 Abdiel Janulgue   2021-04-29  450  	if (query.num_regions)
710217292a6111 Abdiel Janulgue   2021-04-29  451  		return -EINVAL;
710217292a6111 Abdiel Janulgue   2021-04-29  452  
710217292a6111 Abdiel Janulgue   2021-04-29  453  	for (i = 0; i < ARRAY_SIZE(query.rsvd); i++) {
710217292a6111 Abdiel Janulgue   2021-04-29  454  		if (query.rsvd[i])
710217292a6111 Abdiel Janulgue   2021-04-29  455  			return -EINVAL;
710217292a6111 Abdiel Janulgue   2021-04-29  456  	}
710217292a6111 Abdiel Janulgue   2021-04-29  457  
710217292a6111 Abdiel Janulgue   2021-04-29  458  	for_each_memory_region(mr, i915, id) {
710217292a6111 Abdiel Janulgue   2021-04-29  459  		if (mr->private)
710217292a6111 Abdiel Janulgue   2021-04-29  460  			continue;
710217292a6111 Abdiel Janulgue   2021-04-29  461  
710217292a6111 Abdiel Janulgue   2021-04-29  462  		info.region.memory_class = mr->type;
710217292a6111 Abdiel Janulgue   2021-04-29  463  		info.region.memory_instance = mr->instance;
710217292a6111 Abdiel Janulgue   2021-04-29  464  		info.probed_size = mr->total;
710217292a6111 Abdiel Janulgue   2021-04-29  465  		info.unallocated_size = mr->avail;
710217292a6111 Abdiel Janulgue   2021-04-29  466  
710217292a6111 Abdiel Janulgue   2021-04-29  467  		if (__copy_to_user(info_ptr, &info, sizeof(info)))
710217292a6111 Abdiel Janulgue   2021-04-29  468  			return -EFAULT;
710217292a6111 Abdiel Janulgue   2021-04-29  469  
710217292a6111 Abdiel Janulgue   2021-04-29  470  		query.num_regions++;
710217292a6111 Abdiel Janulgue   2021-04-29  471  		info_ptr++;
710217292a6111 Abdiel Janulgue   2021-04-29  472  	}
710217292a6111 Abdiel Janulgue   2021-04-29  473  
710217292a6111 Abdiel Janulgue   2021-04-29  474  	if (__copy_to_user(query_ptr, &query, sizeof(query)))
710217292a6111 Abdiel Janulgue   2021-04-29  475  		return -EFAULT;
710217292a6111 Abdiel Janulgue   2021-04-29  476  
710217292a6111 Abdiel Janulgue   2021-04-29  477  	return total_length;
710217292a6111 Abdiel Janulgue   2021-04-29  478  }
710217292a6111 Abdiel Janulgue   2021-04-29  479  

:::::: The code at line 439 was first introduced by commit
:::::: 710217292a61110a8ccf010cf6886d25e34bf024 drm/i915/query: Expose memory regions through the query uAPI

:::::: TO: Abdiel Janulgue <abdiel.janulgue@xxxxxxxxxxxxxxx>
:::::: CC: Matthew Auld <matthew.auld@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux