kselftest/arm64: Use shared OPTIMZER_HIDE_VAR() definiton
authorMark Brown <broonie@kernel.org>
Thu, 27 Jul 2023 23:26:16 +0000 (00:26 +0100)
committerWill Deacon <will@kernel.org>
Fri, 4 Aug 2023 16:36:52 +0000 (17:36 +0100)
We had open coded the definition of OPTIMIZER_HIDE_VAR() as a fix but now
that we have the generic tools/include available and that has had a
definition of OPTIMIZER_HIDE_VAR() we can switch to the define.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230728-arm64-signal-memcpy-fix-v4-5-0c1290db5d46@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
tools/testing/selftests/arm64/signal/test_signals_utils.h

index c7f5627171dd85313b548f5f40dbac1eb2ab7315..762c8fe9c54adc2c3ea5540a9fa94a63839a2759 100644 (file)
@@ -8,6 +8,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <linux/compiler.h>
+
 #include "test_signals.h"
 
 int test_init(struct tdescr *td);
@@ -76,7 +78,7 @@ static __always_inline bool get_current_context(struct tdescr *td,
         */
        for (i = 0; i < td->live_sz; i++) {
                uc[i] = 0;
-               __asm__ ("" : "=r" (uc[i]) : "0" (uc[i]));
+               OPTIMIZER_HIDE_VAR(uc[0]);
        }
 
        td->live_uc = dest_uc;