summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-05-02 23:30:16 -0700
committerGerrit <chrome-bot@google.com>2012-05-03 17:38:57 -0700
commitf47291926afce3235421f73811a04324195f3e13 (patch)
tree200ad9edd254c2190a4f1a7b4eeaa4e62447c132
parent23429d3d782f7506fb4747356974294cce08ac47 (diff)
downloadvboot-f47291926afce3235421f73811a04324195f3e13.tar.gz
Require -Wall -Werror for everything.
BUG=none TEST=none Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678 Reviewed-on: https://gerrit.chromium.org/gerrit/21748 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
-rw-r--r--Makefile4
-rw-r--r--cgpt/cgpt_boot.c6
-rw-r--r--cgpt/cgpt_find.c6
-rw-r--r--cgpt/cgpt_show.c21
-rw-r--r--cgpt/cmd_add.c4
-rw-r--r--cgpt/cmd_boot.c2
-rw-r--r--cgpt/cmd_create.c2
-rw-r--r--cgpt/cmd_prioritize.c3
-rw-r--r--cgpt/cmd_repair.c2
-rw-r--r--cgpt/cmd_show.c2
-rw-r--r--firmware/stub/vboot_api_stub.c1
-rw-r--r--host/arch/arm/lib/crossystem_arch.c3
-rw-r--r--host/arch/x86/lib/crossystem_arch.c2
-rw-r--r--utility/dump_fmap.c2
-rw-r--r--utility/dump_kernel_config.c5
-rw-r--r--utility/dump_kernel_config_main.c3
-rw-r--r--utility/vbutil_kernel.c11
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 <errno.h>
#include <fcntl.h>
#include <string.h>
+#include <unistd.h>
+#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 <string.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <unistd.h>
-#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(&params, 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(&params, 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(&params, 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(&params, 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(&params, 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(&params, 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 <stdio.h>
#include <sys/mman.h>
+#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 <getopt.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
+#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;