All of lore.kernel.org
 help / color / mirror / Atom feed
* [jfern:sched/ilb-no-needs-kick 1/2] arch/powerpc/include/asm/cmpxchg.h:703:37: warning: passing argument 1 of '__cmpxchg' makes pointer from integer without a cast
@ 2023-10-18  7:06 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-10-18  7:06 UTC (permalink / raw)
  To: Joel Fernandes (Google); +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git sched/ilb-no-needs-kick
head:   2ffef1b93f5fd543729d603697bed169dba84cb6
commit: f1ce99013bb325ab42d7f80f72edd96da8b415c5 [1/2] sched/nohz: Update nohz.next_balance directly without IPIs
config: powerpc64-randconfig-001-20231018 (https://download.01.org/0day-ci/archive/20231018/202310181237.2BN7MQgR-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310181237.2BN7MQgR-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/202310181237.2BN7MQgR-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4836:38: warning: passing argument 1 of 'instrument_atomic_read_write' makes pointer from integer without a cast [-Wint-conversion]
    4836 |         instrument_atomic_read_write(__ai_ptr, sizeof(*__ai_ptr)); \
         |                                      ^~~~~~~~
         |                                      |
         |                                      int
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   In file included from include/asm-generic/bitops/instrumented-atomic.h:14,
                    from arch/powerpc/include/asm/bitops.h:332,
                    from include/linux/bitops.h:68,
                    from include/linux/kernel.h:22,
                    from include/linux/cpumask.h:10:
   include/linux/instrumented.h:94:79: note: expected 'const volatile void *' but argument is of type 'int'
      94 | static __always_inline void instrument_atomic_read_write(const volatile void *v, size_t size)
         |                                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from include/linux/atomic.h:80:
   include/linux/atomic/atomic-arch-fallback.h:191:16: error: invalid type argument of unary '*' (have 'int')
     191 |         typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
         |                ^~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:191:34: error: initialization of 'int *' from incompatible pointer type 'long unsigned int *' [-Werror=incompatible-pointer-types]
     191 |         typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
         |                                  ^
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   In file included from arch/powerpc/include/asm/atomic.h:11,
                    from include/linux/atomic.h:7:
   arch/powerpc/include/asm/cmpxchg.h:701:17: error: invalid type argument of unary '*' (have 'int')
     701 |      __typeof__(*(ptr)) _o_ = (o);                                       \
         |                 ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:192:16: note: in expansion of macro 'raw_cmpxchg'
     192 |         ___r = raw_cmpxchg((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   arch/powerpc/include/asm/cmpxchg.h:702:17: error: invalid type argument of unary '*' (have 'int')
     702 |      __typeof__(*(ptr)) _n_ = (n);                                       \
         |                 ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:192:16: note: in expansion of macro 'raw_cmpxchg'
     192 |         ___r = raw_cmpxchg((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   arch/powerpc/include/asm/cmpxchg.h:703:18: error: invalid type argument of unary '*' (have 'int')
     703 |      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,           \
         |                  ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:192:16: note: in expansion of macro 'raw_cmpxchg'
     192 |         ___r = raw_cmpxchg((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   arch/powerpc/include/asm/cmpxchg.h:704:64: error: invalid type argument of unary '*' (have 'int')
     704 |                                     (unsigned long)_n_, sizeof(*(ptr))); \
         |                                                                ^~~~~~
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:192:16: note: in expansion of macro 'raw_cmpxchg'
     192 |         ___r = raw_cmpxchg((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
>> arch/powerpc/include/asm/cmpxchg.h:703:37: warning: passing argument 1 of '__cmpxchg' makes pointer from integer without a cast [-Wint-conversion]
     703 |      (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,           \
         |                                     ^~~~~
         |                                     |
         |                                     int
   include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg'
      55 | #define raw_cmpxchg arch_cmpxchg
         |                     ^~~~~~~~~~~~
   include/linux/atomic/atomic-arch-fallback.h:192:16: note: in expansion of macro 'raw_cmpxchg'
     192 |         ___r = raw_cmpxchg((_ptr), ___o, (_new)); \
         |                ^~~~~~~~~~~
   include/linux/atomic/atomic-instrumented.h:4838:9: note: in expansion of macro 'raw_try_cmpxchg'
    4838 |         raw_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
         |         ^~~~~~~~~~~~~~~
   kernel/sched/fair.c:11307:18: note: in expansion of macro 'try_cmpxchg'
   11307 |         } while(!try_cmpxchg(&nohz.next_balance, &nohz_next_balance,
         |                  ^~~~~~~~~~~
   arch/powerpc/include/asm/cmpxchg.h:621:26: note: expected 'volatile void *' but argument is of type 'int'
     621 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
         |           ~~~~~~~~~~~~~~~^~~
   cc1: some warnings being treated as errors


vim +/__cmpxchg +703 arch/powerpc/include/asm/cmpxchg.h

56c08e6d226c86 Boqun Feng    2015-12-15  679  
56c08e6d226c86 Boqun Feng    2015-12-15  680  static __always_inline unsigned long
56c08e6d226c86 Boqun Feng    2015-12-15  681  __cmpxchg_acquire(void *ptr, unsigned long old, unsigned long new,
56c08e6d226c86 Boqun Feng    2015-12-15  682  		  unsigned int size)
56c08e6d226c86 Boqun Feng    2015-12-15  683  {
56c08e6d226c86 Boqun Feng    2015-12-15  684  	switch (size) {
d0563a1297e234 Pan Xinhui    2016-04-27  685  	case 1:
d0563a1297e234 Pan Xinhui    2016-04-27  686  		return __cmpxchg_u8_acquire(ptr, old, new);
d0563a1297e234 Pan Xinhui    2016-04-27  687  	case 2:
d0563a1297e234 Pan Xinhui    2016-04-27  688  		return __cmpxchg_u16_acquire(ptr, old, new);
56c08e6d226c86 Boqun Feng    2015-12-15  689  	case 4:
56c08e6d226c86 Boqun Feng    2015-12-15  690  		return __cmpxchg_u32_acquire(ptr, old, new);
56c08e6d226c86 Boqun Feng    2015-12-15  691  #ifdef CONFIG_PPC64
56c08e6d226c86 Boqun Feng    2015-12-15  692  	case 8:
56c08e6d226c86 Boqun Feng    2015-12-15  693  		return __cmpxchg_u64_acquire(ptr, old, new);
56c08e6d226c86 Boqun Feng    2015-12-15  694  #endif
56c08e6d226c86 Boqun Feng    2015-12-15  695  	}
10d8b1480e6966 pan xinhui    2016-02-23  696  	BUILD_BUG_ON_MSG(1, "Unsupported size for __cmpxchg_acquire");
56c08e6d226c86 Boqun Feng    2015-12-15  697  	return old;
56c08e6d226c86 Boqun Feng    2015-12-15  698  }
9eaa82935dccb7 Mark Rutland  2021-05-25  699  #define arch_cmpxchg(ptr, o, n)						 \
ae3a197e3d0bfe David Howells 2012-03-28  700    ({									 \
ae3a197e3d0bfe David Howells 2012-03-28  701       __typeof__(*(ptr)) _o_ = (o);					 \
ae3a197e3d0bfe David Howells 2012-03-28  702       __typeof__(*(ptr)) _n_ = (n);					 \
ae3a197e3d0bfe David Howells 2012-03-28 @703       (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,		 \
ae3a197e3d0bfe David Howells 2012-03-28  704  				    (unsigned long)_n_, sizeof(*(ptr))); \
ae3a197e3d0bfe David Howells 2012-03-28  705    })
ae3a197e3d0bfe David Howells 2012-03-28  706  
ae3a197e3d0bfe David Howells 2012-03-28  707  

:::::: The code at line 703 was first introduced by commit
:::::: ae3a197e3d0bfe3f4bf1693723e82dc018c096f3 Disintegrate asm/system.h for PowerPC

:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: David Howells <dhowells@redhat.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-10-18  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18  7:06 [jfern:sched/ilb-no-needs-kick 1/2] arch/powerpc/include/asm/cmpxchg.h:703:37: warning: passing argument 1 of '__cmpxchg' makes pointer from integer without a cast 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.