• W
    compiler.h: Move compiletime_assert() macros into compiler_types.h · eb5c2d4b
    Will Deacon 提交于
    The kernel test robot reports that moving READ_ONCE() out into its own
    header breaks a W=1 build for parisc, which is relying on the definition
    of compiletime_assert() being available:
    
      | In file included from ./arch/parisc/include/generated/asm/rwonce.h:1,
      |                  from ./include/asm-generic/barrier.h:16,
      |                  from ./arch/parisc/include/asm/barrier.h:29,
      |                  from ./arch/parisc/include/asm/atomic.h:11,
      |                  from ./include/linux/atomic.h:7,
      |                  from kernel/locking/percpu-rwsem.c:2:
      | ./arch/parisc/include/asm/atomic.h: In function 'atomic_read':
      | ./include/asm-generic/rwonce.h:36:2: error: implicit declaration of function 'compiletime_assert' [-Werror=implicit-function-declaration]
      |    36 |  compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
      |       |  ^~~~~~~~~~~~~~~~~~
      | ./include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type'
      |    49 |  compiletime_assert_rwonce_type(x);    \
      |       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | ./arch/parisc/include/asm/atomic.h:73:9: note: in expansion of macro 'READ_ONCE'
      |    73 |  return READ_ONCE((v)->counter);
      |       |         ^~~~~~~~~
    
    Move these macros into compiler_types.h, so that they are available to
    READ_ONCE() and friends.
    
    Link: http://lists.infradead.org/pipermail/linux-arm-kernel/2020-July/587094.htmlReported-by: Nkernel test robot <lkp@intel.com>
    Signed-off-by: NWill Deacon <will@kernel.org>
    eb5c2d4b
compiler.h 8.3 KB