summaryrefslogtreecommitdiff
path: root/firmware/lib/cgptlib
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2010-06-21 16:33:26 -0700
committerRandall Spangler <rspangler@chromium.org>2010-06-21 16:33:26 -0700
commitbeb5bae09f7c7153a1a89946026ba2af8cf3c838 (patch)
tree3770ff6d580e480b9060068078061e6ba956ac14 /firmware/lib/cgptlib
parentf7a45cc01d7e4056482b2cdc23080bfabbbffc76 (diff)
downloadvboot-beb5bae09f7c7153a1a89946026ba2af8cf3c838.tar.gz
Fixes to compiler warnings in MSVC
Review URL: http://codereview.chromium.org/2851015
Diffstat (limited to 'firmware/lib/cgptlib')
-rw-r--r--firmware/lib/cgptlib/cgptlib.c18
-rw-r--r--firmware/lib/cgptlib/cgptlib_internal.c2
2 files changed, 16 insertions, 4 deletions
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index 4d2ee6c0..8b3b6489 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -22,8 +22,10 @@ int GptInit(GptData *gpt) {
gpt->current_priority = 999;
retval = GptSanityCheck(gpt);
- if (GPT_SUCCESS != retval)
+ if (GPT_SUCCESS != retval) {
+ debug("GptInit() failed sanity check\n");
return retval;
+ }
GptRepair(gpt);
return GPT_SUCCESS;
@@ -36,7 +38,7 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) {
GptEntry* e;
int new_kernel = CGPT_KERNEL_ENTRY_NOT_FOUND;
int new_prio = 0;
- int i;
+ uint32_t i;
/* If we already found a kernel, continue the scan at the current
* kernel's prioity, in case there is another kernel with the same
@@ -46,12 +48,16 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) {
e = entries + i;
if (!IsKernelEntry(e))
continue;
+ debug("GptNextKernelEntry looking at same prio partition %d\n", i);
+ 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;
+ debug("GptNextKernelEntry likes that one\n");
return GPT_SUCCESS;
}
}
@@ -63,6 +69,9 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) {
int current_prio = GetEntryPriority(e);
if (!IsKernelEntry(e))
continue;
+ debug("GptNextKernelEntry looking at new prio partition %d\n", i);
+ 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)
@@ -79,9 +88,12 @@ int GptNextKernelEntry(GptData* gpt, uint64_t* start_sector, uint64_t* size) {
gpt->current_kernel = new_kernel;
gpt->current_priority = new_prio;
- if (CGPT_KERNEL_ENTRY_NOT_FOUND == new_kernel)
+ if (CGPT_KERNEL_ENTRY_NOT_FOUND == new_kernel) {
+ debug("GptNextKernelEntry no more kernels\n");
return GPT_ERROR_NO_VALID_KERNEL;
+ }
+ debug("GptNextKernelEntry likes that one\n");
e = entries + new_kernel;
*start_sector = e->starting_lba;
*size = e->ending_lba - e->starting_lba + 1;
diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c
index 85b49061..a436d8f3 100644
--- a/firmware/lib/cgptlib/cgptlib_internal.c
+++ b/firmware/lib/cgptlib/cgptlib_internal.c
@@ -119,7 +119,7 @@ int CheckEntries(GptEntry* entries, GptHeader* h, uint64_t drive_sectors) {
GptEntry* entry;
uint32_t crc32;
- int i;
+ uint32_t i;
/* Check CRC before examining entries. */
crc32 = Crc32((const uint8_t *)entries,