summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2023-03-22 13:25:00 +0000
committerAndre Przywara <andre.przywara@arm.com>2023-03-22 13:33:22 +0000
commitd7f3ed3655b85223583d8c2d9e719f364266ef26 (patch)
tree053daae5ab14ac72abd729c591778bbbee693c67 /Makefile
parent1f8be7fc66fb59b197dde3b4ea83314b1728c6b8 (diff)
downloadarm-trusted-firmware-d7f3ed3655b85223583d8c2d9e719f364266ef26.tar.gz
fix(cpufeat): make stub enable functions "static inline"
For builds where we don't have a certain feature enabled, we provide empty stub xxx_enable() functions in a header file. This way we avoid #ifdef's in the code, and can call the enable function unconditionally. When compiling with -O1 or higher, the compiler will even optimise out the whole call, so the symbol will never make it into any object file. When compiling with optimisations turned off, the function stub will survive, and could make it into multiple object files, which would lead to a multiple definitons error. Avoid this by defining those stub functions as "static inline". The "static" will avoid the multiple definitions problems, the "inline" will avoid a potential compiler warning about unused functions. This patterns is used extensively in the Linux kernel. Change-Id: Iad07bb946aab372587c83f2423b4983bf3817990 Reported-by: Chris Kay <chris.kay@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions