From f47291926afce3235421f73811a04324195f3e13 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Wed, 2 May 2012 23:30:16 -0700 Subject: Require -Wall -Werror for everything. BUG=none TEST=none Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678 Reviewed-on: https://gerrit.chromium.org/gerrit/21748 Commit-Ready: Bill Richardson Tested-by: Bill Richardson Reviewed-by: Stefan Reinauer --- Makefile | 4 ++-- cgpt/cgpt_boot.c | 6 +++--- cgpt/cgpt_find.c | 6 +++--- cgpt/cgpt_show.c | 21 --------------------- cgpt/cmd_add.c | 4 ---- cgpt/cmd_boot.c | 2 -- cgpt/cmd_create.c | 2 -- cgpt/cmd_prioritize.c | 3 --- cgpt/cmd_repair.c | 2 -- cgpt/cmd_show.c | 2 -- firmware/stub/vboot_api_stub.c | 1 - host/arch/arm/lib/crossystem_arch.c | 3 +-- host/arch/x86/lib/crossystem_arch.c | 2 +- utility/dump_fmap.c | 2 +- utility/dump_kernel_config.c | 5 ++--- utility/dump_kernel_config_main.c | 3 ++- utility/vbutil_kernel.c | 11 ----------- 17 files changed, 15 insertions(+), 64 deletions(-) diff --git a/Makefile b/Makefile index 78840b77..b6b44ecd 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ export ARCH=amd64 endif ifeq ($(FIRMWARE_ARCH),) -CFLAGS += -DCHROMEOS_ENVIRONMENT +CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall -Werror endif ifneq (${DEBUG},) @@ -106,7 +106,7 @@ all: done libcgpt_cc: - mkdir -p ${BUILD}/cgpt ${BUILD}/firmware/lib/cgptlib ${BUILD}/firmware/stub + mkdir -p ${BUILD}/cgpt ${BUILD}/firmware/lib/cgptlib ${BUILD}/firmware/stub $(MAKE) -C cgpt libcgpt_cc cgptmanager_tests: libcgpt_cc diff --git a/cgpt/cgpt_boot.c b/cgpt/cgpt_boot.c index f8e712d6..d3d207a7 100644 --- a/cgpt/cgpt_boot.c +++ b/cgpt/cgpt_boot.c @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cgpt.h" - #include #include #include +#include +#include "cgpt.h" +#include "cgpt_params.h" #include "cgptlib_internal.h" #include "endian.h" -#include "cgpt_params.h" int cgpt_get_boot_partition_number(CgptBootParams *params) { diff --git a/cgpt/cgpt_find.c b/cgpt/cgpt_find.c index 345c8310..7ca158ac 100644 --- a/cgpt/cgpt_find.c +++ b/cgpt/cgpt_find.c @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cgpt.h" - #include #include #include +#include -#include "cgptlib_internal.h" +#include "cgpt.h" #include "cgpt_params.h" +#include "cgptlib_internal.h" #define BUFSIZE 1024 // FIXME: currently we only support 512-byte sectors. diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c index f0022a9d..47599f42 100644 --- a/cgpt/cgpt_show.c +++ b/cgpt/cgpt_show.c @@ -11,27 +11,6 @@ #include "cgptlib_internal.h" #include "cgpt_params.h" -static void Usage(void) { - printf("\nUsage: %s show [OPTIONS] DRIVE\n\n" - "Display the GPT table\n\n" - "Options:\n" - " -n Numeric output only\n" - " -v Verbose output\n" - " -q Quick output\n" - " -i NUM Show specified partition only - pick one of:\n" - " -b beginning sector\n" - " -s partition size\n" - " -t type guid\n" - " -u unique guid\n" - " -l label\n" - " -S Successful flag\n" - " -T Tries flag\n" - " -P Priority flag\n" - " -A raw 64-bit attribute value\n" - "\n", progname); -} - - /* Generate output like: * * [AB-CD-EF-01] for group = 1 diff --git a/cgpt/cmd_add.c b/cgpt/cmd_add.c index 62b15996..3a211cd3 100644 --- a/cgpt/cmd_add.c +++ b/cgpt/cmd_add.c @@ -36,10 +36,6 @@ int cmd_add(int argc, char *argv[]) { CgptAddParams params; memset(¶ms, 0, sizeof(params)); - int gpt_retval; - GptEntry *entry; - uint32_t index; - int c; int errorcnt = 0; char *e = 0; diff --git a/cgpt/cmd_boot.c b/cgpt/cmd_boot.c index fc5c36e7..05ba6e93 100644 --- a/cgpt/cmd_boot.c +++ b/cgpt/cmd_boot.c @@ -24,8 +24,6 @@ static void Usage(void) int cmd_boot(int argc, char *argv[]) { - struct drive drive; - CgptBootParams params; memset(¶ms, 0, sizeof(params)); diff --git a/cgpt/cmd_create.c b/cgpt/cmd_create.c index f982be8a..cf7b80ce 100644 --- a/cgpt/cmd_create.c +++ b/cgpt/cmd_create.c @@ -19,8 +19,6 @@ static void Usage(void) } int cmd_create(int argc, char *argv[]) { - struct drive drive; - CgptCreateParams params; memset(¶ms, 0, sizeof(params)); diff --git a/cgpt/cmd_prioritize.c b/cgpt/cmd_prioritize.c index eca72ac8..b81bda0c 100644 --- a/cgpt/cmd_prioritize.c +++ b/cgpt/cmd_prioritize.c @@ -32,12 +32,9 @@ static void Usage(void) } int cmd_prioritize(int argc, char *argv[]) { - struct drive drive; - CgptPrioritizeParams params; memset(¶ms, 0, sizeof(params)); - int c; int errorcnt = 0; char *e = 0; diff --git a/cgpt/cmd_repair.c b/cgpt/cmd_repair.c index 493b22b6..4f1bc026 100644 --- a/cgpt/cmd_repair.c +++ b/cgpt/cmd_repair.c @@ -19,8 +19,6 @@ static void Usage(void) } int cmd_repair(int argc, char *argv[]) { - struct drive drive; - CgptRepairParams params; memset(¶ms, 0, sizeof(params)); diff --git a/cgpt/cmd_show.c b/cgpt/cmd_show.c index 3f22751a..6443931f 100644 --- a/cgpt/cmd_show.c +++ b/cgpt/cmd_show.c @@ -32,8 +32,6 @@ static void Usage(void) } int cmd_show(int argc, char *argv[]) { - struct drive drive; - CgptShowParams params; memset(¶ms, 0, sizeof(params)); diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c index f3289e2b..78eb7649 100644 --- a/firmware/stub/vboot_api_stub.c +++ b/firmware/stub/vboot_api_stub.c @@ -47,7 +47,6 @@ void VbExError(const char* format, ...) { void VbExDebug(const char* format, ...) { va_list ap; - int i; va_start(ap, format); fprintf(stderr, "DEBUG: "); vfprintf(stderr, fixfmt(format), ap); diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index 305fddf3..1fa900a4 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -160,12 +160,11 @@ static char * ReadFdtString(const char *property) { static char * ReadFdtPlatformFamily(void) { char *compat = NULL; char *s; - FILE *file; const PlatformFamily* p; size_t size = 0; int slen; - if(ReadFdtBlock(FDT_COMPATIBLE_PATH, &compat, &size)) + if(ReadFdtBlock(FDT_COMPATIBLE_PATH, (void **)&compat, &size)) return NULL; if (size > 0) diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c index 74411044..b0ab10fa 100644 --- a/host/arch/x86/lib/crossystem_arch.c +++ b/host/arch/x86/lib/crossystem_arch.c @@ -106,7 +106,7 @@ const PlatformFamily platform_family_array[] = { {0x8086, 0x0154, "IvyBridge"}, /* mobile */ {0x8086, 0x0150, "IvyBridge"}, /* desktop */ /* Terminate with NULL entry */ - {NULL, NULL, NULL} + {0, 0, 0} }; static void VbFixCmosChecksum(FILE* file) { diff --git a/utility/dump_fmap.c b/utility/dump_fmap.c index daffdf3b..d4a3eb1c 100644 --- a/utility/dump_fmap.c +++ b/utility/dump_fmap.c @@ -28,7 +28,7 @@ static void* base_of_rom; /* Return 0 if successful */ static int dump_fmap(const void* ptr, int argc, char *argv[]) { - int i,j,retval = 0; + int i, retval = 0; char buf[80]; // DWR: magic number const FmapHeader* fmh = (const FmapHeader*) ptr; const FmapAreaHeader* ah = (const FmapAreaHeader*) (ptr + sizeof(FmapHeader)); diff --git a/utility/dump_kernel_config.c b/utility/dump_kernel_config.c index b01aedb8..a6989e1c 100644 --- a/utility/dump_kernel_config.c +++ b/utility/dump_kernel_config.c @@ -5,20 +5,19 @@ * Exports the kernel commandline from a given partition/image. */ -#include "dump_kernel_config.h" - #include #include +#include "dump_kernel_config.h" #include "host_common.h" #include "kernel_blob.h" +#include "vboot_api.h" uint8_t* find_kernel_config(uint8_t* blob, uint64_t blob_size, uint64_t kernel_body_load_address) { VbKeyBlockHeader* key_block; VbKernelPreambleHeader* preamble; - struct linux_kernel_params *params; uint32_t now = 0; uint32_t offset = 0; diff --git a/utility/dump_kernel_config_main.c b/utility/dump_kernel_config_main.c index ed77f879..20a51871 100644 --- a/utility/dump_kernel_config_main.c +++ b/utility/dump_kernel_config_main.c @@ -5,14 +5,15 @@ * Exports the kernel commandline from a given partition/image. */ -#include "dump_kernel_config.h" #include #include #include #include +#include "dump_kernel_config.h" #include "kernel_blob.h" +#include "vboot_api.h" enum { OPT_KLOADADDR = 1000, diff --git a/utility/vbutil_kernel.c b/utility/vbutil_kernel.c index f75d8a7c..29d508a0 100644 --- a/utility/vbutil_kernel.c +++ b/utility/vbutil_kernel.c @@ -158,15 +158,6 @@ static void Fatal(const char *format, ...) { exit(1); } -static void Warning(const char *format, ...) { - va_list ap; - va_start(ap, format); - fprintf(stderr, "WARNING: "); - vfprintf(stderr, format, ap); - va_end(ap); -} - - /* Return an explanation when fread() fails. */ static const char *error_fread(FILE *fp) { const char *retval = "beats me why"; @@ -451,7 +442,6 @@ static void UnpackKernelBlob(uint8_t *kernel_blob_data, g_preamble->body_load_address; uint64_t p_ofs = b_ofs - CROS_CONFIG_SIZE; uint64_t c_ofs = p_ofs - CROS_PARAMS_SIZE; - uint64_t k_size = c_ofs; Debug("k_blob_size = 0x%" PRIx64 "\n", k_blob_size ); Debug("k_blob_ofs = 0x%" PRIx64 "\n", k_blob_ofs ); @@ -536,7 +526,6 @@ static int Pack(const char* outfile, uint64_t kernel_body_load_address, VbPrivateKey* signpriv_key) { VbSignature* body_sig; - uint64_t key_block_size; FILE* f; uint64_t i; uint64_t written = 0; -- cgit v1.2.1