From ab63d3c20b8be3f610fff454260f02ab1d7c02b6 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 26 Feb 2013 09:51:58 -0600 Subject: [PATCH] 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 Reviewed-on: https://gerrit.chromium.org/gerrit/44044 Reviewed-by: Bill Richardson Reviewed-by: Randall Spangler --- firmware/lib/rollback_index.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c index 1dd2f9e433..0c6e02acfd 100644 --- a/firmware/lib/rollback_index.c +++ b/firmware/lib/rollback_index.c @@ -42,11 +42,11 @@ static int g_rollback_recovery_mode = 0; __pragma(warning (disable: 4127)) #define RETURN_ON_FAILURE(tpm_command) do { \ - uint32_t result; \ - if ((result = (tpm_command)) != TPM_SUCCESS) { \ + uint32_t result_; \ + if ((result_ = (tpm_command)) != TPM_SUCCESS) { \ VBDEBUG(("Rollback: %08x returned by " #tpm_command \ - "\n", (int)result)); \ - return result; \ + "\n", (int)result_)); \ + return result_; \ } \ } while (0)