[s390:features 40/44] drivers/gpu/drm/drm_lock.c:75:24: sparse: sparse: incorrect type in argument 1 (different modifiers)

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
head:   9d42a4d3e27db3cabad82483ed876d4c8b8bed65
commit: 000174233b91340ca52a9eca905d029a9a2aefd9 [40/44] s390/atomic,cmpxchg: switch to use atomic-instrumented.h
config: s390-randconfig-s032-20210412 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-280-g2cd6d34e-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/commit/?id=000174233b91340ca52a9eca905d029a9a2aefd9
        git remote add s390 https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git
        git fetch --no-tags s390 features
        git checkout 000174233b91340ca52a9eca905d029a9a2aefd9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

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


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/drm_lock.c:75:24: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void *ptr @@     got unsigned int volatile *__ai_ptr @@
   drivers/gpu/drm/drm_lock.c:75:24: sparse:     expected void *ptr
   drivers/gpu/drm/drm_lock.c:75:24: sparse:     got unsigned int volatile *__ai_ptr
   drivers/gpu/drm/drm_lock.c:118:24: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void *ptr @@     got unsigned int volatile *__ai_ptr @@
   drivers/gpu/drm/drm_lock.c:118:24: sparse:     expected void *ptr
   drivers/gpu/drm/drm_lock.c:118:24: sparse:     got unsigned int volatile *__ai_ptr
   drivers/gpu/drm/drm_lock.c:141:24: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void *ptr @@     got unsigned int volatile *__ai_ptr @@
   drivers/gpu/drm/drm_lock.c:141:24: sparse:     expected void *ptr
   drivers/gpu/drm/drm_lock.c:141:24: sparse:     got unsigned int volatile *__ai_ptr
   drivers/gpu/drm/drm_lock.c:319:40: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void *ptr @@     got unsigned int volatile *__ai_ptr @@
   drivers/gpu/drm/drm_lock.c:319:40: sparse:     expected void *ptr
   drivers/gpu/drm/drm_lock.c:319:40: sparse:     got unsigned int volatile *__ai_ptr

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@xxxxxxxx>
:::::: CC: Daniel Vetter <daniel.vetter@xxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux