All of lore.kernel.org
 help / color / mirror / Atom feed
* [csky-linux:sg2042-master-qspinlock-64ilp32_v4 28/70] drivers/gpu/drm/drm_lock.c:75:10: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers
@ 2023-08-03 16:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-08-03 16:03 UTC (permalink / raw)
  To: Guo Ren; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/c-sky/csky-linux sg2042-master-qspinlock-64ilp32_v4
head:   ee021e57ffe3195b6a3ac5fcb2d4353375d1f261
commit: 1ff8b01f77a24e9bf21d6189f8913393494a2bd8 [28/70] RISC-V: paravirt: pvqspinlock: Add xchg8 & cmpxchg_small support
config: riscv-randconfig-r042-20230731 (https://download.01.org/0day-ci/archive/20230803/202308032302.dN849WQv-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230803/202308032302.dN849WQv-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/202308032302.dN849WQv-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/drm_lock.c:75:10: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
      75 |                 prev = cmpxchg(lock, old, new);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4746:2: note: expanded from macro 'cmpxchg'
    4746 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: expanded from macro 'raw_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^
   arch/riscv/include/asm/cmpxchg.h:452:23: note: expanded from macro 'arch_cmpxchg'
     452 |         (__typeof__(*(ptr))) __cmpxchg((ptr),                           \
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     453 |                                        _o_, _n_, sizeof(*(ptr)));       \
         |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:415:20: note: expanded from macro '__cmpxchg'
     415 |                         __cmpxchg_small(__ptr, (ulong)__old,            \
         |                                         ^~~~~
   arch/riscv/include/asm/cmpxchg.h:360:43: note: passing argument to parameter 'ptr' here
     360 | static inline ulong __cmpxchg_small(void *ptr, ulong old,
         |                                           ^
   drivers/gpu/drm/drm_lock.c:118:10: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     118 |                 prev = cmpxchg(lock, old, new);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4746:2: note: expanded from macro 'cmpxchg'
    4746 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: expanded from macro 'raw_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^
   arch/riscv/include/asm/cmpxchg.h:452:23: note: expanded from macro 'arch_cmpxchg'
     452 |         (__typeof__(*(ptr))) __cmpxchg((ptr),                           \
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     453 |                                        _o_, _n_, sizeof(*(ptr)));       \
         |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:415:20: note: expanded from macro '__cmpxchg'
     415 |                         __cmpxchg_small(__ptr, (ulong)__old,            \
         |                                         ^~~~~
   arch/riscv/include/asm/cmpxchg.h:360:43: note: passing argument to parameter 'ptr' here
     360 | static inline ulong __cmpxchg_small(void *ptr, ulong old,
         |                                           ^
   drivers/gpu/drm/drm_lock.c:141:10: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     141 |                 prev = cmpxchg(lock, old, new);
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4746:2: note: expanded from macro 'cmpxchg'
    4746 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: expanded from macro 'raw_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^
   arch/riscv/include/asm/cmpxchg.h:452:23: note: expanded from macro 'arch_cmpxchg'
     452 |         (__typeof__(*(ptr))) __cmpxchg((ptr),                           \
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     453 |                                        _o_, _n_, sizeof(*(ptr)));       \
         |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:415:20: note: expanded from macro '__cmpxchg'
     415 |                         __cmpxchg_small(__ptr, (ulong)__old,            \
         |                                         ^~~~~
   arch/riscv/include/asm/cmpxchg.h:360:43: note: passing argument to parameter 'ptr' here
     360 | static inline ulong __cmpxchg_small(void *ptr, ulong old,
         |                                           ^
   drivers/gpu/drm/drm_lock.c:319:12: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     319 |                                 prev = cmpxchg(lock, old, DRM_KERNEL_CONTEXT);
         |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4746:2: note: expanded from macro 'cmpxchg'
    4746 |         raw_cmpxchg(__ai_ptr, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: expanded from macro 'raw_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^
   arch/riscv/include/asm/cmpxchg.h:452:23: note: expanded from macro 'arch_cmpxchg'
     452 |         (__typeof__(*(ptr))) __cmpxchg((ptr),                           \
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     453 |                                        _o_, _n_, sizeof(*(ptr)));       \
         |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/riscv/include/asm/cmpxchg.h:415:20: note: expanded from macro '__cmpxchg'
     415 |                         __cmpxchg_small(__ptr, (ulong)__old,            \
         |                                         ^~~~~
   arch/riscv/include/asm/cmpxchg.h:360:43: note: passing argument to parameter 'ptr' here
     360 | static inline ulong __cmpxchg_small(void *ptr, ulong old,
         |                                           ^
   4 errors generated.


vim +75 drivers/gpu/drm/drm_lock.c

4ac5ec40ec7002 Daniel Vetter     2010-08-23  48  
bd50d4a2168370 Benjamin Gaignard 2020-03-06  49  /*
1a75a222f5ca10 Daniel Vetter     2016-06-14  50   * Take the heavyweight lock.
1a75a222f5ca10 Daniel Vetter     2016-06-14  51   *
1a75a222f5ca10 Daniel Vetter     2016-06-14  52   * \param lock lock pointer.
1a75a222f5ca10 Daniel Vetter     2016-06-14  53   * \param context locking context.
1a75a222f5ca10 Daniel Vetter     2016-06-14  54   * \return one if the lock is held, or zero otherwise.
1a75a222f5ca10 Daniel Vetter     2016-06-14  55   *
1a75a222f5ca10 Daniel Vetter     2016-06-14  56   * Attempt to mark the lock as held by the given context, via the \p cmpxchg instruction.
1a75a222f5ca10 Daniel Vetter     2016-06-14  57   */
1a75a222f5ca10 Daniel Vetter     2016-06-14  58  static
1a75a222f5ca10 Daniel Vetter     2016-06-14  59  int drm_lock_take(struct drm_lock_data *lock_data,
1a75a222f5ca10 Daniel Vetter     2016-06-14  60  		  unsigned int context)
1a75a222f5ca10 Daniel Vetter     2016-06-14  61  {
1a75a222f5ca10 Daniel Vetter     2016-06-14  62  	unsigned int old, new, prev;
1a75a222f5ca10 Daniel Vetter     2016-06-14  63  	volatile unsigned int *lock = &lock_data->hw_lock->lock;
1a75a222f5ca10 Daniel Vetter     2016-06-14  64  
1a75a222f5ca10 Daniel Vetter     2016-06-14  65  	spin_lock_bh(&lock_data->spinlock);
1a75a222f5ca10 Daniel Vetter     2016-06-14  66  	do {
1a75a222f5ca10 Daniel Vetter     2016-06-14  67  		old = *lock;
1a75a222f5ca10 Daniel Vetter     2016-06-14  68  		if (old & _DRM_LOCK_HELD)
1a75a222f5ca10 Daniel Vetter     2016-06-14  69  			new = old | _DRM_LOCK_CONT;
1a75a222f5ca10 Daniel Vetter     2016-06-14  70  		else {
1a75a222f5ca10 Daniel Vetter     2016-06-14  71  			new = context | _DRM_LOCK_HELD |
1a75a222f5ca10 Daniel Vetter     2016-06-14  72  				((lock_data->user_waiters + lock_data->kernel_waiters > 1) ?
1a75a222f5ca10 Daniel Vetter     2016-06-14  73  				 _DRM_LOCK_CONT : 0);
1a75a222f5ca10 Daniel Vetter     2016-06-14  74  		}
1a75a222f5ca10 Daniel Vetter     2016-06-14 @75  		prev = cmpxchg(lock, old, new);
1a75a222f5ca10 Daniel Vetter     2016-06-14  76  	} while (prev != old);
1a75a222f5ca10 Daniel Vetter     2016-06-14  77  	spin_unlock_bh(&lock_data->spinlock);
1a75a222f5ca10 Daniel Vetter     2016-06-14  78  
1a75a222f5ca10 Daniel Vetter     2016-06-14  79  	if (_DRM_LOCKING_CONTEXT(old) == context) {
1a75a222f5ca10 Daniel Vetter     2016-06-14  80  		if (old & _DRM_LOCK_HELD) {
1a75a222f5ca10 Daniel Vetter     2016-06-14  81  			if (context != DRM_KERNEL_CONTEXT) {
1a75a222f5ca10 Daniel Vetter     2016-06-14  82  				DRM_ERROR("%d holds heavyweight lock\n",
1a75a222f5ca10 Daniel Vetter     2016-06-14  83  					  context);
1a75a222f5ca10 Daniel Vetter     2016-06-14  84  			}
1a75a222f5ca10 Daniel Vetter     2016-06-14  85  			return 0;
1a75a222f5ca10 Daniel Vetter     2016-06-14  86  		}
1a75a222f5ca10 Daniel Vetter     2016-06-14  87  	}
1a75a222f5ca10 Daniel Vetter     2016-06-14  88  
1a75a222f5ca10 Daniel Vetter     2016-06-14  89  	if ((_DRM_LOCKING_CONTEXT(new)) == context && (new & _DRM_LOCK_HELD)) {
1a75a222f5ca10 Daniel Vetter     2016-06-14  90  		/* Have lock */
1a75a222f5ca10 Daniel Vetter     2016-06-14  91  		return 1;
1a75a222f5ca10 Daniel Vetter     2016-06-14  92  	}
1a75a222f5ca10 Daniel Vetter     2016-06-14  93  	return 0;
1a75a222f5ca10 Daniel Vetter     2016-06-14  94  }
1a75a222f5ca10 Daniel Vetter     2016-06-14  95  

:::::: The code at line 75 was first introduced by commit
:::::: 1a75a222f5ca1063249b5c92972d32dcc3c8966e drm: Hide hw.lock cleanup in filp->release better

:::::: TO: Daniel Vetter <daniel.vetter@ffwll.ch>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>

-- 
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-08-03 16:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 16:03 [csky-linux:sg2042-master-qspinlock-64ilp32_v4 28/70] drivers/gpu/drm/drm_lock.c:75:10: error: passing 'typeof ((__ai_ptr))' (aka 'volatile unsigned int *') to parameter of type 'void *' discards qualifiers 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.