From 7aa88748f6ec4e53333d1a15747bc44826ccc410 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 28 Sep 2016 11:42:17 -0700 Subject: Turn on -Werror for recovery Also remove the 0xff comparison when validating the bootloader message fields. As the fields won't be erased to 0xff after we remove the MTD support. Bug: 28202046 Test: The recovery folder compiles for aosp_x86-eng Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab --- recovery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'recovery.cpp') diff --git a/recovery.cpp b/recovery.cpp index 91c18b529..12df61db8 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -306,12 +306,12 @@ get_args(int *argc, char ***argv) { get_bootloader_message(&boot); // this may fail, leaving a zeroed structure stage = strndup(boot.stage, sizeof(boot.stage)); - if (boot.command[0] != 0 && boot.command[0] != 255) { + if (boot.command[0] != 0) { std::string boot_command = std::string(boot.command, sizeof(boot.command)); LOG(INFO) << "Boot command: " << boot_command; } - if (boot.status[0] != 0 && boot.status[0] != 255) { + if (boot.status[0] != 0) { std::string boot_status = std::string(boot.status, sizeof(boot.status)); LOG(INFO) << "Boot status: " << boot_status; } @@ -328,7 +328,7 @@ get_args(int *argc, char ***argv) { (*argv)[*argc] = strdup(arg); } LOG(INFO) << "Got arguments from boot message"; - } else if (boot.recovery[0] != 0 && boot.recovery[0] != 255) { + } else if (boot.recovery[0] != 0) { std::string boot_recovery = std::string(boot.recovery, 20); LOG(ERROR) << "Bad boot message\n" << "\"" <