From 84f685035fbfb44d9b389bfa7ee441dcabac95a2 Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Thu, 29 Aug 2019 13:18:18 +0800 Subject: vboot/secdata: fix up macros in rollback_index.c Remove the unnecessary offsetof declaration in rollback_index.c, and fix some macro formatting. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I156a0561070e03f978fff307d3dbfafde09e0adf Signed-off-by: Joel Kitching Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1773093 Commit-Queue: Joel Kitching Tested-by: Joel Kitching Reviewed-by: Julius Werner --- firmware/lib/rollback_index.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c index 004d3ba0..b273d23d 100644 --- a/firmware/lib/rollback_index.c +++ b/firmware/lib/rollback_index.c @@ -14,17 +14,13 @@ #include "tss_constants.h" #include "vboot_api.h" -#ifndef offsetof -#define offsetof(A,B) __builtin_offsetof(A,B) -#endif - -#define RETURN_ON_FAILURE(tpm_command) do { \ - uint32_t result_; \ - if ((result_ = (tpm_command)) != TPM_SUCCESS) { \ +#define RETURN_ON_FAILURE(tpm_command) do { \ + uint32_t result_; \ + if ((result_ = (tpm_command)) != TPM_SUCCESS) { \ VB2_DEBUG("Rollback: %08x returned by " #tpm_command \ - "\n", (int)result_); \ - return result_; \ - } \ + "\n", (int)result_); \ + return result_; \ + } \ } while (0) #define PRINT_BYTES(title, value) do { \ -- cgit v1.2.1