From 1e7b7cbc58a2d22fe1e788067cd0a15c93e7b2af Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 26 Aug 2024 15:30:32 -0700 Subject: [PATCH] Move variable only used on aarch64. The kTagGranuleSize is only used in aarch64, so you can get unused variable warnings for other targets. Move this definition closer to where it's used and in aarch64 code. Test: Build with unused checking on. Change-Id: I9baf660430508ee3ca1efb62585ee1b038c6b0f3 --- debuggerd/debuggerd_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 08619b980c..962097e65d 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -86,7 +86,6 @@ using ::testing::HasSubstr; #define ARCH_SUFFIX "" #endif -constexpr size_t kTagGranuleSize = 16; constexpr char kWaitForDebuggerKey[] = "debug.debuggerd.wait_for_debugger"; #define TIMEOUT(seconds, expr) \ @@ -742,6 +741,8 @@ TEST_F(CrasherTest, mte_multiple_causes) { } #if defined(__aarch64__) +constexpr size_t kTagGranuleSize = 16; + static uintptr_t CreateTagMapping() { // Some of the MTE tag dump tests assert that there is an inaccessible page to the left and right // of the PROT_MTE page, so map three pages and set the two guard pages to PROT_NONE. -- GitLab