Hi Miguel, I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master] [also build test WARNING on v4.19-rc1 next-20180831] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Miguel-Ojeda/Compiler-Attributes-remove-unused-attributes/20180901-125644 config: sh-titan_defconfig (attached as .config) compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=sh All warnings (new ones prefixed by >>): In file included from include/linux/byteorder/little_endian.h:5:0, from arch/sh/include/uapi/asm/byteorder.h:6, from arch/sh/include/asm/bitops.h:12, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/uapi/linux/byteorder/little_endian.h:84:1: warning: 'gnu_inline' attribute ignored [-Wattributes] static __always_inline __be16 __cpu_to_be16p(const __u16 *p) ^~~~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: 'no_instrument_function' attribute applies only to functions #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/uapi/linux/byteorder/little_endian.h:84:8: note: in expansion of macro '__always_inline' static __always_inline __be16 __cpu_to_be16p(const __u16 *p) ^~~~~~~~~~~~~~~ In file included from include/linux/byteorder/little_endian.h:5:0, from arch/sh/include/uapi/asm/byteorder.h:6, from arch/sh/include/asm/bitops.h:12, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/uapi/linux/byteorder/little_endian.h:84:1: warning: 'always_inline' attribute ignored [-Wattributes] static __always_inline __be16 __cpu_to_be16p(const __u16 *p) ^~~~~~ include/uapi/linux/byteorder/little_endian.h:84:24: error: expected ',' or ';' before '__be16' static __always_inline __be16 __cpu_to_be16p(const __u16 *p) ^~~~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: type defaults to 'int' in declaration of '__always_inline' [-Werror=implicit-int] #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/uapi/linux/byteorder/little_endian.h:88:8: note: in expansion of macro '__always_inline' static __always_inline __u16 __be16_to_cpup(const __be16 *p) ^~~~~~~~~~~~~~~ In file included from include/linux/byteorder/little_endian.h:5:0, from arch/sh/include/uapi/asm/byteorder.h:6, from arch/sh/include/asm/bitops.h:12, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/uapi/linux/byteorder/little_endian.h:88:1: warning: 'gnu_inline' attribute ignored [-Wattributes] static __always_inline __u16 __be16_to_cpup(const __be16 *p) ^~~~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: 'no_instrument_function' attribute applies only to functions #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/uapi/linux/byteorder/little_endian.h:88:8: note: in expansion of macro '__always_inline' static __always_inline __u16 __be16_to_cpup(const __be16 *p) ^~~~~~~~~~~~~~~ In file included from include/linux/byteorder/little_endian.h:5:0, from arch/sh/include/uapi/asm/byteorder.h:6, from arch/sh/include/asm/bitops.h:12, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/uapi/linux/byteorder/little_endian.h:88:1: warning: 'always_inline' attribute ignored [-Wattributes] static __always_inline __u16 __be16_to_cpup(const __be16 *p) ^~~~~~ include/uapi/linux/byteorder/little_endian.h:88:24: error: expected ',' or ';' before '__u16' static __always_inline __u16 __be16_to_cpup(const __be16 *p) ^~~~~ In file included from include/asm-generic/bug.h:5:0, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/linux/atomic.h: In function 'atomic_fetch_add_unless': include/linux/compiler.h:252:3: error: implicit declaration of function '__read_once_size' [-Werror=implicit-function-declaration] __read_once_size(&(x), __u.__c, sizeof(x)); \ ^ include/linux/compiler.h:258:22: note: in expansion of macro '__READ_ONCE' #define READ_ONCE(x) __READ_ONCE(x, 1) ^~~~~~~~~~~ >> arch/sh/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE' #define atomic_read(v) READ_ONCE((v)->counter) ^~~~~~~~~ include/linux/atomic.h:575:10: note: in expansion of macro 'atomic_read' int c = atomic_read(v); ^~~~~~~~~~~ include/linux/compiler.h:254:3: error: implicit declaration of function '__read_once_size_nocheck' [-Werror=implicit-function-declaration] __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ ^ include/linux/compiler.h:258:22: note: in expansion of macro '__READ_ONCE' #define READ_ONCE(x) __READ_ONCE(x, 1) ^~~~~~~~~~~ >> arch/sh/include/asm/atomic.h:24:25: note: in expansion of macro 'READ_ONCE' #define atomic_read(v) READ_ONCE((v)->counter) ^~~~~~~~~ include/linux/atomic.h:575:10: note: in expansion of macro 'atomic_read' int c = atomic_read(v); ^~~~~~~~~~~ include/asm-generic/atomic-long.h: In function 'atomic_long_set': include/linux/compiler.h:277:2: error: implicit declaration of function '__write_once_size'; did you mean '__builtin_object_size'? [-Werror=implicit-function-declaration] __write_once_size(&(x), __u.__c, sizeof(x)); \ ^ >> arch/sh/include/asm/atomic.h:25:26: note: in expansion of macro 'WRITE_ONCE' #define atomic_set(v,i) WRITE_ONCE((v)->counter, (i)) ^~~~~~~~~~ include/asm-generic/atomic-long.h:35:28: note: in expansion of macro 'atomic_set' #define ATOMIC_LONG_PFX(x) atomic ## x ^~~~~~ include/asm-generic/atomic-long.h:57:2: note: in expansion of macro 'ATOMIC_LONG_PFX' ATOMIC_LONG_PFX(_set##mo)(v, i); \ ^~~~~~~~~~~~~~~ include/asm-generic/atomic-long.h:59:1: note: in expansion of macro 'ATOMIC_LONG_SET_OP' ATOMIC_LONG_SET_OP() ^~~~~~~~~~~~~~~~~~ In file included from <command-line>:0:0: include/asm-generic/atomic-long.h: At top level: include/linux/compiler_types.h:187:16: error: type defaults to 'int' in declaration of '__always_inline' [-Werror=implicit-int] #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/asm-generic/atomic-long.h:119:8: note: in expansion of macro '__always_inline' static __always_inline void atomic_long_inc(atomic_long_t *l) ^~~~~~~~~~~~~~~ In file included from include/linux/atomic.h:1315:0, from include/asm-generic/bitops/atomic.h:5, from arch/sh/include/asm/bitops.h:25, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/asm-generic/atomic-long.h:119:1: warning: 'gnu_inline' attribute ignored [-Wattributes] static __always_inline void atomic_long_inc(atomic_long_t *l) ^~~~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: 'no_instrument_function' attribute applies only to functions #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/asm-generic/atomic-long.h:119:8: note: in expansion of macro '__always_inline' static __always_inline void atomic_long_inc(atomic_long_t *l) ^~~~~~~~~~~~~~~ In file included from include/linux/atomic.h:1315:0, from include/asm-generic/bitops/atomic.h:5, from arch/sh/include/asm/bitops.h:25, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/asm-generic/atomic-long.h:119:1: warning: 'always_inline' attribute ignored [-Wattributes] static __always_inline void atomic_long_inc(atomic_long_t *l) ^~~~~~ include/asm-generic/atomic-long.h:119:24: error: expected ',' or ';' before 'void' static __always_inline void atomic_long_inc(atomic_long_t *l) ^~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: type defaults to 'int' in declaration of '__always_inline' [-Werror=implicit-int] #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/asm-generic/atomic-long.h:126:8: note: in expansion of macro '__always_inline' static __always_inline void atomic_long_dec(atomic_long_t *l) ^~~~~~~~~~~~~~~ In file included from include/linux/atomic.h:1315:0, from include/asm-generic/bitops/atomic.h:5, from arch/sh/include/asm/bitops.h:25, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/page-flags.h:10, from kernel/bounds.c:10: include/asm-generic/atomic-long.h:126:1: warning: 'gnu_inline' attribute ignored [-Wattributes] static __always_inline void atomic_long_dec(atomic_long_t *l) ^~~~~~ In file included from <command-line>:0:0: include/linux/compiler_types.h:187:16: error: 'no_instrument_function' attribute applies only to functions #define inline __always_inline __gnu_inline __maybe_unused notrace ^ include/linux/compiler_attributes.h:48:33: note: in expansion of macro 'inline' #define __always_inline inline __attribute__((always_inline)) ^~~~~~ include/asm-generic/atomic-long.h:126:8: note: in expansion of macro '__always_inline' static __always_inline void atomic_long_dec(atomic_long_t *l) ^~~~~~~~~~~~~~~ In file included from include/linux/atomic.h:1315:0, from include/asm-generic/bitops/atomic.h:5, from arch/sh/include/asm/bitops.h:25, from include/linux/bitops.h:19, from include/linux/kernel.h:11, from include/asm-generic/bug.h:18, vim +/READ_ONCE +24 arch/sh/include/asm/atomic.h ^1da177e include/asm-sh/atomic.h Linus Torvalds 2005-04-16 23 62e8a325 arch/sh/include/asm/atomic.h Peter Zijlstra 2015-09-18 @24 #define atomic_read(v) READ_ONCE((v)->counter) 62e8a325 arch/sh/include/asm/atomic.h Peter Zijlstra 2015-09-18 @25 #define atomic_set(v,i) WRITE_ONCE((v)->counter, (i)) ^1da177e include/asm-sh/atomic.h Linus Torvalds 2005-04-16 26 :::::: The code at line 24 was first introduced by commit :::::: 62e8a3258bda118f24ff462fe04cfbe75b8189b5 atomic, arch: Audit atomic_{read,set}() :::::: TO: Peter Zijlstra <pet...@infradead.org> :::::: CC: Ingo Molnar <mi...@kernel.org> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip