diff options
author | Randall Spangler <rspangler@chromium.org> | 2017-01-03 13:49:18 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-01-12 15:56:27 -0800 |
commit | 21015898b39aa8742057ed6e6423c308c8d0a15d (patch) | |
tree | 8221b6a48e13d8cdf15820cc92247167f8ac5fe0 /firmware/lib/cgptlib | |
parent | df4eb2bb7be9d61bfe9bdf6c33f836f358b18cf6 (diff) | |
download | vboot-21015898b39aa8742057ed6e6423c308c8d0a15d.tar.gz |
firmware: replace VBDEBUG(()) macro with VB2_DEBUG()
The original VBDEBUG macro used doubly-nested parens to work with
MSVC, which didn't support varargs in macros. We now only use more
modern compilers, so replace it with the VB2_DEBUG macro and get rid
of the ugly and fragile double parens.
BUG=chromium:611535
BRANCH=none
TEST=make runtests; build_packages --board=reef chromeos-firmware
Change-Id: Ifc0cb0733b14daaa1fde095fab7da4215a538c77
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/425133
Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'firmware/lib/cgptlib')
-rw-r--r-- | firmware/lib/cgptlib/cgptlib.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c index 954ca5fa..449ed2f0 100644 --- a/firmware/lib/cgptlib/cgptlib.c +++ b/firmware/lib/cgptlib/cgptlib.c @@ -3,8 +3,10 @@ * found in the LICENSE file. */ -#include "sysincludes.h" +#include "2sysincludes.h" +#include "2common.h" +#include "sysincludes.h" #include "cgptlib.h" #include "cgptlib_internal.h" #include "crc32.h" @@ -22,7 +24,7 @@ int GptInit(GptData *gpt) retval = GptSanityCheck(gpt); if (GPT_SUCCESS != retval) { - VBDEBUG(("GptInit() failed sanity check\n")); + VB2_DEBUG("GptInit() failed sanity check\n"); return retval; } @@ -50,18 +52,18 @@ int GptNextKernelEntry(GptData *gpt, uint64_t *start_sector, uint64_t *size) e = entries + i; if (!IsKernelEntry(e)) continue; - VBDEBUG(("GptNextKernelEntry looking at same prio " - "partition %d\n", i+1)); - VBDEBUG(("GptNextKernelEntry s%d t%d p%d\n", - GetEntrySuccessful(e), GetEntryTries(e), - GetEntryPriority(e))); + VB2_DEBUG("GptNextKernelEntry looking at same prio " + "partition %d\n", i+1); + VB2_DEBUG("GptNextKernelEntry s%d t%d p%d\n", + GetEntrySuccessful(e), GetEntryTries(e), + GetEntryPriority(e)); if (!(GetEntrySuccessful(e) || GetEntryTries(e))) continue; if (GetEntryPriority(e) == gpt->current_priority) { gpt->current_kernel = i; *start_sector = e->starting_lba; *size = e->ending_lba - e->starting_lba + 1; - VBDEBUG(("GptNextKernelEntry likes it\n")); + VB2_DEBUG("GptNextKernelEntry likes it\n"); return GPT_SUCCESS; } } @@ -75,11 +77,11 @@ int GptNextKernelEntry(GptData *gpt, uint64_t *start_sector, uint64_t *size) int current_prio = GetEntryPriority(e); if (!IsKernelEntry(e)) continue; - VBDEBUG(("GptNextKernelEntry looking at new prio " - "partition %d\n", i+1)); - VBDEBUG(("GptNextKernelEntry s%d t%d p%d\n", - GetEntrySuccessful(e), GetEntryTries(e), - GetEntryPriority(e))); + VB2_DEBUG("GptNextKernelEntry looking at new prio " + "partition %d\n", i+1); + VB2_DEBUG("GptNextKernelEntry s%d t%d p%d\n", + GetEntrySuccessful(e), GetEntryTries(e), + GetEntryPriority(e)); if (!(GetEntrySuccessful(e) || GetEntryTries(e))) continue; if (current_prio >= gpt->current_priority) { @@ -101,11 +103,11 @@ int GptNextKernelEntry(GptData *gpt, uint64_t *start_sector, uint64_t *size) gpt->current_priority = new_prio; if (CGPT_KERNEL_ENTRY_NOT_FOUND == new_kernel) { - VBDEBUG(("GptNextKernelEntry no more kernels\n")); + VB2_DEBUG("GptNextKernelEntry no more kernels\n"); return GPT_ERROR_NO_VALID_KERNEL; } - VBDEBUG(("GptNextKernelEntry likes partition %d\n", new_kernel + 1)); + VB2_DEBUG("GptNextKernelEntry likes partition %d\n", new_kernel + 1); e = entries + new_kernel; *start_sector = e->starting_lba; *size = e->ending_lba - e->starting_lba + 1; |