rollback_index: fix -Wshadow warnings

The rollback_index.c file uses a macro RETURN_ON_FAILURE which creates
a locally block-scoped variable named 'result'. However, when built with
-Wshadow -Werror the compile will break because the 'result' variable
will shadow the one function scoped variable. Fix this warning by
changing the variable name from 'result'  to 'result_' in
the RETURN_ON_FAILURE macro.

BUG=chrome-os-partner:17695
BRANCH=None
TEST=built fwlib with -Werror -Wshadow. Compiles correctly.
     runtests still passes as well.

Change-Id: I9fedef5567411beacdc1c0b8ed182573601f24aa
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44044
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Aaron Durbin
2013-02-26 09:51:58 -06:00
committed by ChromeBot
parent 9d7d0cbe13
commit ab63d3c20b

View File

@@ -42,11 +42,11 @@ static int g_rollback_recovery_mode = 0;
__pragma(warning (disable: 4127)) __pragma(warning (disable: 4127))
#define RETURN_ON_FAILURE(tpm_command) do { \ #define RETURN_ON_FAILURE(tpm_command) do { \
uint32_t result; \ uint32_t result_; \
if ((result = (tpm_command)) != TPM_SUCCESS) { \ if ((result_ = (tpm_command)) != TPM_SUCCESS) { \
VBDEBUG(("Rollback: %08x returned by " #tpm_command \ VBDEBUG(("Rollback: %08x returned by " #tpm_command \
"\n", (int)result)); \ "\n", (int)result_)); \
return result; \ return result_; \
} \ } \
} while (0) } while (0)