From: Geert Uytterhoeven Date: Thu, 1 Feb 2018 10:21:58 +0000 (+0100) Subject: compiler-gcc.h: Introduce __optimize function attribute X-Git-Tag: v4.14.21~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=045e5161abfcfefce5b2777788e5913d85bb5c6f;p=platform%2Fkernel%2Flinux-rpi.git compiler-gcc.h: Introduce __optimize function attribute commit df5d45aa08f848b79caf395211b222790534ccc7 upstream. Create a new function attribute __optimize, which allows to specify an optimization level on a per-function basis. Signed-off-by: Geert Uytterhoeven Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 2272ded..7bba8e2 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -196,6 +196,10 @@ #endif /* __CHECKER__ */ #endif /* GCC_VERSION >= 40300 */ +#if GCC_VERSION >= 40400 +#define __optimize(level) __attribute__((__optimize__(level))) +#endif /* GCC_VERSION >= 40400 */ + #if GCC_VERSION >= 40500 #ifndef __CHECKER__ diff --git a/include/linux/compiler.h b/include/linux/compiler.h index fab5dc2..e8c9cd1 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -266,6 +266,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s #endif /* __ASSEMBLY__ */ +#ifndef __optimize +# define __optimize(level) +#endif + /* Compile time object size, -1 for unknown */ #ifndef __compiletime_object_size # define __compiletime_object_size(obj) -1