[powerpc:next 81/84] arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1 of '__cmpxchg' discards 'volatile' qualifier from pointer target type
From: kbuild test robot <hidden>
Date: 2016-11-23 18:30:06
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next head: 3382a6220ff3bac886d9d90766f3fe18cf25b468 commit: d0563a1297e234ed37f6b51c2e9321accebd1839 [81/84] powerpc: Implement {cmp}xchg for u8 and u16 config: powerpc-allyesconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout d0563a1297e234ed37f6b51c2e9321accebd1839 # save the attached .config to linux build tree make.cross ARCH=powerpc All warnings (new ones prefixed by >>): In file included from arch/powerpc/include/asm/pgtable-be-types.h:4:0, from arch/powerpc/include/asm/page.h:292, from arch/powerpc/include/asm/book3s/64/mmu-hash.h:16, from arch/powerpc/include/asm/book3s/64/mmu.h:29, from arch/powerpc/include/asm/mmu.h:282, from arch/powerpc/include/asm/lppaca.h:36, from arch/powerpc/include/asm/paca.h:21, from arch/powerpc/include/asm/current.h:16, from include/linux/mutex.h:13, from include/linux/kernfs.h:13, from include/linux/sysfs.h:15, from include/linux/kobject.h:21, from include/linux/cdev.h:4, from include/drm/drmP.h:36, from drivers/gpu/drm/drm_lock.c:37: drivers/gpu/drm/drm_lock.c: In function 'drm_lock_take':
quoted
arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1 of '__cmpxchg' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
^quoted
drivers/gpu/drm/drm_lock.c:69:10: note: in expansion of macro 'cmpxchg'
prev = cmpxchg(lock, old, new);
^~~~~~~
arch/powerpc/include/asm/cmpxchg.h:402:1: note: expected 'void *' but argument is of type 'volatile unsigned int *'
__cmpxchg(void *ptr, unsigned long old, unsigned long new,
^~~~~~~~~
drivers/gpu/drm/drm_lock.c: In function 'drm_lock_transfer':quoted
arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1 of '__cmpxchg' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
^
drivers/gpu/drm/drm_lock.c:112:10: note: in expansion of macro 'cmpxchg'
prev = cmpxchg(lock, old, new);
^~~~~~~
arch/powerpc/include/asm/cmpxchg.h:402:1: note: expected 'void *' but argument is of type 'volatile unsigned int *'
__cmpxchg(void *ptr, unsigned long old, unsigned long new,
^~~~~~~~~
drivers/gpu/drm/drm_lock.c: In function 'drm_legacy_lock_free':quoted
arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1 of '__cmpxchg' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
^
drivers/gpu/drm/drm_lock.c:135:10: note: in expansion of macro 'cmpxchg'
prev = cmpxchg(lock, old, new);
^~~~~~~
arch/powerpc/include/asm/cmpxchg.h:402:1: note: expected 'void *' but argument is of type 'volatile unsigned int *'
__cmpxchg(void *ptr, unsigned long old, unsigned long new,
^~~~~~~~~
drivers/gpu/drm/drm_lock.c: In function 'drm_legacy_idlelock_release':quoted
arch/powerpc/include/asm/cmpxchg.h:484:37: warning: passing argument 1 of '__cmpxchg' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
^
drivers/gpu/drm/drm_lock.c:313:12: note: in expansion of macro 'cmpxchg'
prev = cmpxchg(lock, old, DRM_KERNEL_CONTEXT);
^~~~~~~
arch/powerpc/include/asm/cmpxchg.h:402:1: note: expected 'void *' but argument is of type 'volatile unsigned int *'
__cmpxchg(void *ptr, unsigned long old, unsigned long new,
^~~~~~~~~
vim +484 arch/powerpc/include/asm/cmpxchg.h
d0563a12 Pan Xinhui 2016-04-27 468 case 2:
d0563a12 Pan Xinhui 2016-04-27 469 return __cmpxchg_u16_acquire(ptr, old, new);
56c08e6d Boqun Feng 2015-12-15 470 case 4:
56c08e6d Boqun Feng 2015-12-15 471 return __cmpxchg_u32_acquire(ptr, old, new);
56c08e6d Boqun Feng 2015-12-15 472 #ifdef CONFIG_PPC64
56c08e6d Boqun Feng 2015-12-15 473 case 8:
56c08e6d Boqun Feng 2015-12-15 474 return __cmpxchg_u64_acquire(ptr, old, new);
56c08e6d Boqun Feng 2015-12-15 475 #endif
56c08e6d Boqun Feng 2015-12-15 476 }
10d8b148 pan xinhui 2016-02-23 477 BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_acquire");
56c08e6d Boqun Feng 2015-12-15 478 return old;
56c08e6d Boqun Feng 2015-12-15 479 }
ae3a197e David Howells 2012-03-28 480 #define cmpxchg(ptr, o, n) \
ae3a197e David Howells 2012-03-28 481 ({ \
ae3a197e David Howells 2012-03-28 482 __typeof__(*(ptr)) _o_ = (o); \
ae3a197e David Howells 2012-03-28 483 __typeof__(*(ptr)) _n_ = (n); \
ae3a197e David Howells 2012-03-28 @484 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
ae3a197e David Howells 2012-03-28 485 (unsigned long)_n_, sizeof(*(ptr))); \
ae3a197e David Howells 2012-03-28 486 })
ae3a197e David Howells 2012-03-28 487
ae3a197e David Howells 2012-03-28 488
ae3a197e David Howells 2012-03-28 489 #define cmpxchg_local(ptr, o, n) \
ae3a197e David Howells 2012-03-28 490 ({ \
ae3a197e David Howells 2012-03-28 491 __typeof__(*(ptr)) _o_ = (o); \
ae3a197e David Howells 2012-03-28 492 __typeof__(*(ptr)) _n_ = (n); \
:::::: The code at line 484 was first introduced by commit
:::::: ae3a197e3d0bfe3f4bf1693723e82dc018c096f3 Disintegrate asm/system.h for PowerPC
:::::: TO: David Howells [off-list ref]
:::::: CC: David Howells [off-list ref]
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation Attachments
- .config.gz [application/gzip] 50934 bytes