diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-09-21 23:33:00 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-28 16:50:00 +0000 |
commit | b95efb8c5013d629201ff01646c4eebb7144c31d (patch) | |
tree | 4e933a0e9a81e187f7056686b8653c7d9fe32f0a | |
parent | 16c1d44caebe58dbd4af36b603a0c929764873a9 (diff) | |
download | chrome-ec-b95efb8c5013d629201ff01646c4eebb7144c31d.tar.gz |
test/rollback_entropy: Add __maybe_unused to arrays
Clang warns that "_EXPECTED_SECRET is not needed and will not be
emitted". The same warning occurs for _EXPECTED_SECRET2, and
_EXPECTED_UNINITIALIZED_ROLLBACK_SECRET. While this is true, we still
want the BUILD_ASSERT() evaluated at compile time, so mark it as
"__maybe_unused" to suppress the warning.
BRANCH=none
BUG=b:172020503
TEST=make buildall -j
TEST=make BOARD=dartmonkey tests -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I6ab0f4070654e74c1c8ef5d1ba7b125d490633f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3174597
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | test/rollback_entropy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/rollback_entropy.c b/test/rollback_entropy.c index 8b9ace2f31..788fab2572 100644 --- a/test/rollback_entropy.c +++ b/test/rollback_entropy.c @@ -30,7 +30,7 @@ static const uint8_t FAKE_ENTROPY[] = { 0x89, 0x0e, 0xd8, 0x2c, 0xf0, 0x9f, 0x22, 0x24, 0x3b, 0xdc, 0x42, \ 0x52, 0xe4, 0xd7, 0x9c, 0x8a, 0x98, 0x10, 0xc1, 0x39, 0x1f, 0x45, \ 0x5d, 0xce, 0x37, 0xa7, 0xb7, 0x32, 0xeb, 0x0a, 0x0e, 0x4f -static const uint8_t _EXPECTED_SECRET[] = { +__maybe_unused static const uint8_t _EXPECTED_SECRET[] = { EXPECTED_SECRET }; BUILD_ASSERT(sizeof(_EXPECTED_SECRET) == CONFIG_ROLLBACK_SECRET_SIZE); @@ -49,7 +49,7 @@ BUILD_ASSERT(sizeof(_EXPECTED_SECRET) == CONFIG_ROLLBACK_SECRET_SIZE); 0xb5, 0xd2, 0xc0, 0x8b, 0x1f, 0x91, 0x09, 0xac, 0x5c, 0x67, 0xde, \ 0x15, 0x48, 0x6f, 0x0a, 0xc2, 0x67, 0xef, 0x95, 0x01, 0xbd, 0x9f, \ 0x64, 0x6f, 0x4e, 0xa8, 0x00, 0x85, 0xcb, 0x08, 0x28, 0x4c -static const uint8_t _EXPECTED_SECRET2[] = { +__maybe_unused static const uint8_t _EXPECTED_SECRET2[] = { EXPECTED_SECRET2 }; BUILD_ASSERT(sizeof(_EXPECTED_SECRET2) == CONFIG_ROLLBACK_SECRET_SIZE); @@ -59,7 +59,8 @@ BUILD_ASSERT(sizeof(_EXPECTED_SECRET2) == CONFIG_ROLLBACK_SECRET_SIZE); 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -static const uint8_t _EXPECTED_UNINITIALIZED_ROLLBACK_SECRET[] = { +__maybe_unused static const uint8_t +_EXPECTED_UNINITIALIZED_ROLLBACK_SECRET[] = { EXPECTED_UNINITIALIZED_ROLLBACK_SECRET }; BUILD_ASSERT(sizeof(_EXPECTED_UNINITIALIZED_ROLLBACK_SECRET) == |