public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [bcachefs:header_cleanup 40/50] drivers/gpu/drm/i915/gem/i915_gem_shmem.c:565:34: warning: result of comparison of constant 17592186040320 with expression of type 'resource_size_t' (aka 'unsigned int') is always false
@ 2023-12-17  3:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-17  3:08 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all, Kent Overstreet

tree:   https://evilpiepirate.org/git/bcachefs.git header_cleanup
head:   7288b19e061b7aa3f46f685e9944af128f10ffd5
commit: 9da0ecf79b1a28b051c2398bcc6c5f606632d19e [40/50] seccomp: Split out seccomp_types.h
config: i386-randconfig-003-20231217 (https://download.01.org/0day-ci/archive/20231217/202312171126.LFwyoDnN-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312171126.LFwyoDnN-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/202312171126.LFwyoDnN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
   warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
   In file included from drivers/gpu/drm/i915/gem/i915_gem_shmem.c:14:
   In file included from drivers/gpu/drm/i915/i915_drv.h:40:
   In file included from drivers/gpu/drm/i915/display/intel_display_core.h:16:
   In file included from include/drm/drm_connector.h:32:
   In file included from include/drm/drm_util.h:36:
   In file included from include/linux/kgdb.h:19:
   In file included from include/linux/kprobes.h:28:
   In file included from include/linux/ftrace.h:16:
   In file included from include/linux/ptrace.h:12:
   include/linux/seccomp.h:49:8: error: redefinition of 'seccomp'
   struct seccomp { };
          ^
   include/linux/seccomp_types.h:20:8: note: previous definition is here
   struct seccomp {
          ^
>> drivers/gpu/drm/i915/gem/i915_gem_shmem.c:565:34: warning: result of comparison of constant 17592186040320 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
           if (BITS_PER_LONG == 64 && size > MAX_LFS_FILESIZE)
                                      ~~~~ ^ ~~~~~~~~~~~~~~~~
   7 warnings and 1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for DRM_I915_DEBUG_GEM
   Depends on [n]: HAS_IOMEM [=y] && DRM_I915 [=m] && EXPERT [=y] && DRM_I915_WERROR [=n]
   Selected by [m]:
   - DRM_I915_DEBUG [=y] && HAS_IOMEM [=y] && DRM_I915 [=m] && EXPERT [=y] && !COMPILE_TEST [=n]


vim +565 drivers/gpu/drm/i915/gem/i915_gem_shmem.c

8475355f7a2645 Chris Wilson    2019-05-28  544  
da1184cd41d4c6 Matthew Auld    2019-10-18  545  static int __create_shmem(struct drm_i915_private *i915,
8475355f7a2645 Chris Wilson    2019-05-28  546  			  struct drm_gem_object *obj,
da1184cd41d4c6 Matthew Auld    2019-10-18  547  			  resource_size_t size)
8475355f7a2645 Chris Wilson    2019-05-28  548  {
8475355f7a2645 Chris Wilson    2019-05-28  549  	unsigned long flags = VM_NORESERVE;
8475355f7a2645 Chris Wilson    2019-05-28  550  	struct file *filp;
8475355f7a2645 Chris Wilson    2019-05-28  551  
8475355f7a2645 Chris Wilson    2019-05-28  552  	drm_gem_private_object_init(&i915->drm, obj, size);
8475355f7a2645 Chris Wilson    2019-05-28  553  
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  554  	/* XXX: The __shmem_file_setup() function returns -EINVAL if size is
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  555  	 * greater than MAX_LFS_FILESIZE.
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  556  	 * To handle the same error as other code that returns -E2BIG when
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  557  	 * the size is too large, we add a code that returns -E2BIG when the
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  558  	 * size is larger than the size that can be handled.
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  559  	 * If BITS_PER_LONG is 32, size > MAX_LFS_FILESIZE is always false,
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  560  	 * so we only needs to check when BITS_PER_LONG is 64.
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  561  	 * If BITS_PER_LONG is 32, E2BIG checks are processed when
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  562  	 * i915_gem_object_size_2big() is called before init_object() callback
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  563  	 * is called.
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  564  	 */
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28 @565  	if (BITS_PER_LONG == 64 && size > MAX_LFS_FILESIZE)
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  566  		return -E2BIG;
662c04e2b8c6fe Gwan-gyeong Mun 2022-12-28  567  
8475355f7a2645 Chris Wilson    2019-05-28  568  	if (i915->mm.gemfs)
8475355f7a2645 Chris Wilson    2019-05-28  569  		filp = shmem_file_setup_with_mnt(i915->mm.gemfs, "i915", size,
8475355f7a2645 Chris Wilson    2019-05-28  570  						 flags);
8475355f7a2645 Chris Wilson    2019-05-28  571  	else
8475355f7a2645 Chris Wilson    2019-05-28  572  		filp = shmem_file_setup("i915", size, flags);
8475355f7a2645 Chris Wilson    2019-05-28  573  	if (IS_ERR(filp))
8475355f7a2645 Chris Wilson    2019-05-28  574  		return PTR_ERR(filp);
8475355f7a2645 Chris Wilson    2019-05-28  575  
8475355f7a2645 Chris Wilson    2019-05-28  576  	obj->filp = filp;
8475355f7a2645 Chris Wilson    2019-05-28  577  	return 0;
8475355f7a2645 Chris Wilson    2019-05-28  578  }
8475355f7a2645 Chris Wilson    2019-05-28  579  

:::::: The code at line 565 was first introduced by commit
:::::: 662c04e2b8c6fe8eb2f2b88c62e25c8241d0f793 drm/i915: Check if the size is too big while creating shmem file

:::::: TO: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
:::::: CC: Rodrigo Vivi <rodrigo.vivi@intel.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-17  3:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-17  3:08 [bcachefs:header_cleanup 40/50] drivers/gpu/drm/i915/gem/i915_gem_shmem.c:565:34: warning: result of comparison of constant 17592186040320 with expression of type 'resource_size_t' (aka 'unsigned int') is always false 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