All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android16-6.12-2025-12 2/2] drivers/gpu/drm/i915/gem/i915_gem_shmem.c:562:34: warning: result of comparison of constant 17592186040320 with expression of type 'resource_size_t' (aka 'unsigned int') is always false
@ 2026-10-14  4:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-14  4:08 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android16-6.12-2025-12
head:   838e65c6c0a82859fe27789f09351ad8be0461c9
commit: e24cc2d5218669b7412788d57528059ec6ecee4e [2/2] ANDROID: ABI: refresh, CRC fixups and allowed breaks
config: i386-randconfig-r2306-20261014 (https://download.01.org/0day-ci/archive/20261014/202610140618.PQZSQmdv-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261014/202610140618.PQZSQmdv-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/202610140618.PQZSQmdv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   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:46:
   In file included from drivers/gpu/drm/i915/gt/intel_engine.h:18:
   In file included from drivers/gpu/drm/i915/gt/intel_gt_types.h:19:
   In file included from drivers/gpu/drm/i915/gt/uc/intel_uc.h:9:
   In file included from drivers/gpu/drm/i915/gt/uc/intel_gsc_uc.h:9:
   In file included from drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h:12:
   In file included from drivers/gpu/drm/i915/intel_device_info.h:36:
   In file included from drivers/gpu/drm/i915/gem/i915_gem_object_types.h:12:
   In file included from include/drm/drm_gem.h:38:
   include/linux/dma-buf.h:547:2: error: static assertion failed due to requirement '__alignof(struct dma_buf::(unnamed union)::(unnamed union)::(unnamed at include/linux/dma-buf.h:547:2)) <= __alignof(struct dma_buf::(unnamed union)::(unnamed union)::(unnamed at include/linux/dma-buf.h:547:2))': include/linux/dma-buf.h:547: u64 __kabi_reserved_backport1 is not aligned the same as atomic64_t nr_task_refs
     547 |         ANDROID_BACKPORT_USE(1, atomic64_t nr_task_refs);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:189:2: note: expanded from macro 'ANDROID_BACKPORT_USE'
     189 |         _ANDROID_KABI_REPLACE(ANDROID_BACKPORT_RESERVE(number), _new)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:79:3: note: expanded from macro '_ANDROID_KABI_REPLACE'
      79 |                 _ANDROID_KABI_NORMAL_SIZE_ALIGN(_orig, _new); \
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:66:4: note: expanded from macro '_ANDROID_KABI_NORMAL_SIZE_ALIGN'
      66 |                         __alignof__(struct { _new; }) <=                \
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      67 |                                 __alignof__(struct { _orig; }),         \
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dma-buf.h:547:2: note: expression evaluates to '8 <= 4'
     547 |         ANDROID_BACKPORT_USE(1, atomic64_t nr_task_refs);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:189:2: note: expanded from macro 'ANDROID_BACKPORT_USE'
     189 |         _ANDROID_KABI_REPLACE(ANDROID_BACKPORT_RESERVE(number), _new)
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:79:3: note: expanded from macro '_ANDROID_KABI_REPLACE'
      79 |                 _ANDROID_KABI_NORMAL_SIZE_ALIGN(_orig, _new); \
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/android_kabi.h:66:34: note: expanded from macro '_ANDROID_KABI_NORMAL_SIZE_ALIGN'
      66 |                         __alignof__(struct { _new; }) <=                \
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      67 |                                 __alignof__(struct { _orig; }),         \
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gem/i915_gem_shmem.c:562: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]
     562 |         if (BITS_PER_LONG == 64 && size > MAX_LFS_FILESIZE)
         |                                    ~~~~ ^ ~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ASYNC_TX_ENABLE_CHANNEL_SWITCH
   Depends on [n]: DMADEVICES [=n]
   Selected by [y]:
   - GKI_HIDDEN_DMA_CONFIGS [=y]
   WARNING: unmet direct dependencies detected for DMA_ENGINE_RAID
   Depends on [n]: DMADEVICES [=n]
   Selected by [y]:
   - GKI_HIDDEN_DMA_CONFIGS [=y]


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

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

:::::: The code at line 562 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:[~2026-10-14  4:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14  4:08 [android-common:android16-6.12-2025-12 2/2] drivers/gpu/drm/i915/gem/i915_gem_shmem.c:562: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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.