fwlib: fix errors with -Wmissing-prototypes

When the fwlib is built with -Wmissing-prototypes and -Werror
there build breakages that occur. Fix these errors by either
including the header file with the correct declaration or provide
the declaration at the top of the c files for global symbols that
are used by tests.

BUG=chrome-os-partner:17695
BRANCH=None
TEST=built fwlib library with -Wmissing-prototypes and -Werror. Also
     'make runtests' still passes.

Change-Id: I992516ee2545509054887173bc65234905381e06
Signed-off-by: Aaron Durbin
Reviewed-on: https://gerrit.chromium.org/gerrit/44042
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Aaron Durbin
2013-02-26 09:40:55 -06:00
committed by ChromeBot
parent e6cf2c21a1
commit 612797edfa
4 changed files with 12 additions and 2 deletions

View File

@@ -12,7 +12,6 @@
#include "cgptlib.h" #include "cgptlib.h"
#include "load_firmware_fw.h" #include "load_firmware_fw.h"
#include "vboot_api.h" #include "vboot_api.h"
#include "vboot_kernel.h"
/** /**
* Allocate and read GPT data from the drive. The sector_bytes and * Allocate and read GPT data from the drive. The sector_bytes and

View File

@@ -17,6 +17,15 @@
#define offsetof(A,B) __builtin_offsetof(A,B) #define offsetof(A,B) __builtin_offsetof(A,B)
#endif #endif
/*
* Provide protoypes for functions not in the header file. These prototypes
* fix -Wmissing-prototypes warnings.
*/
uint32_t ReadSpaceFirmware(RollbackSpaceFirmware *rsf);
uint32_t WriteSpaceFirmware(RollbackSpaceFirmware *rsf);
uint32_t ReadSpaceKernel(RollbackSpaceKernel *rsk);
uint32_t WriteSpaceKernel(RollbackSpaceKernel *rsk);
#ifdef FOR_TEST #ifdef FOR_TEST
/* /*
* Compiling for unit test, so we need the real implementations of * Compiling for unit test, so we need the real implementations of

View File

@@ -96,7 +96,8 @@ const uint8_t kBootInvalidSHA1Digest[] = {
* Given the boot state, return the correct SHA1 digest index for TPMExtend * Given the boot state, return the correct SHA1 digest index for TPMExtend
* in kBootStateSHA1Digests[]. * in kBootStateSHA1Digests[].
*/ */
int GetBootStateIndex(int dev_mode, int rec_mode, uint64_t keyblock_flags) static int GetBootStateIndex(int dev_mode, int rec_mode,
uint64_t keyblock_flags)
{ {
int index = 0; int index = 0;

View File

@@ -13,6 +13,7 @@
#include "vboot_audio.h" #include "vboot_audio.h"
#include "vboot_common.h" #include "vboot_common.h"
#include "vboot_display.h" #include "vboot_display.h"
#include "vboot_kernel.h"
#include "vboot_nvstorage.h" #include "vboot_nvstorage.h"
/* Global variables */ /* Global variables */