]> git.baikalelectronics.ru Git - kernel.git/commit
include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 2 Jan 2019 20:57:49 +0000 (15:57 -0500)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Wed, 9 Jan 2019 10:36:41 +0000 (11:36 +0100)
commite557ca08ec4367a9c3890054e9c2d9bac6eddc4e
tree404f9e5008513f378ebfb74b94e8723ca63113b5
parentd6952d4b95d3a6897fcea7446c97f59f8d24556b
include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR

Since commit bf82e747dd2a ("include/linux/compiler*.h: make compiler-*.h
mutually exclusive") clang no longer reuses the OPTIMIZER_HIDE_VAR macro
from compiler-gcc - instead it gets the version in
include/linux/compiler.h.  Unfortunately that version doesn't actually
prevent compiler from optimizing out the variable.

Fix up by moving the macro out from compiler-gcc.h to compiler.h.
Compilers without incline asm support will keep working
since it's protected by an ifdef.

Also fix up comments to match reality since we are no longer overriding
any macros.

Build-tested with gcc and clang.

Fixes: bf82e747dd2a ("include/linux/compiler*.h: make compiler-*.h mutually exclusive")
Cc: Eli Friedman <efriedma@codeaurora.org>
Cc: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
include/linux/compiler-clang.h
include/linux/compiler-gcc.h
include/linux/compiler-intel.h
include/linux/compiler.h