Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1142)

Unified Diff: vboot_firmware/lib/cgptlib/cgptlib_internal.c

Issue 2829004: More code cleanup (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: rebase Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vboot_firmware/include/load_firmware_fw.h ('k') | vboot_firmware/lib/include/vboot_struct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vboot_firmware/lib/cgptlib/cgptlib_internal.c
diff --git a/vboot_firmware/lib/cgptlib/cgptlib_internal.c b/vboot_firmware/lib/cgptlib/cgptlib_internal.c
index 4f0229362520f47be5d2e086ee826fc59bf9fcf5..7faf3832a32e8701e7010fc0dd46ddece1c3c83e 100644
--- a/vboot_firmware/lib/cgptlib/cgptlib_internal.c
+++ b/vboot_firmware/lib/cgptlib/cgptlib_internal.c
@@ -102,16 +102,16 @@ int CheckHeader(GptHeader *h, int is_secondary, uint64_t drive_sectors) {
}
-/* Return 1 if the entry is unused, 0 if it is used. */
+/* Return non-zero if the entry is unused, 0 if it is used. */
int IsUnusedEntry(const GptEntry* e) {
static Guid zero = {{{0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0}}}};
- return (Memcmp(&zero, (const uint8_t*)(&e->type), sizeof(zero)) ? 0 : 1);
+ return !Memcmp(&zero, (const uint8_t*)(&e->type), sizeof(zero));
}
-/* Returns 1 if the entry is a Chrome OS kernel partition, else 0. */
+/* Returns non-zero if the entry is a Chrome OS kernel partition, else 0. */
int IsKernelEntry(const GptEntry* e) {
static Guid chromeos_kernel = GPT_ENT_TYPE_CHROMEOS_KERNEL;
- return (Memcmp(&e->type, &chromeos_kernel, sizeof(Guid)) ? 0 : 1);
+ return !Memcmp(&e->type, &chromeos_kernel, sizeof(Guid));
}
« no previous file with comments | « vboot_firmware/include/load_firmware_fw.h ('k') | vboot_firmware/lib/include/vboot_struct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698