summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2017-11-30 14:09:06 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-12-08 23:19:25 +0000
commitfa82985a2a7bb58894f26eac9bca774e8064e297 (patch)
treebf17aa530574afb1d526ebcf14d7401b7cca669b
parenta776696d079e1fa8507802a3749951bec98143df (diff)
downloadvboot-fa82985a2a7bb58894f26eac9bca774e8064e297.tar.gz
firmware: header tweaks for depthcharge
Depthcharge currently includes vboot_nvstorage.h directly, instead of including only the API header files directly. Add 2nvstorage.h to the list of headers which can be requested impolitely. Also fix the definition of ARRAY_SIZE to match exactly what depthcharge and coreboot provide, so that the compiler does not get sad when it's included from both libpayload.h and 2common.h. BUG=chromium:789276 BRANCH=none TEST=make runtests; emerge-reef depthcharge coreboot Change-Id: Idc0390eaf813c3079df1676781e8bf5bc9b46450 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/802176 Reviewed-by: Shelley Chen <shchen@chromium.org> (cherry picked from commit f6780a36ff19b36abcdb5ace903c4ae2272fb574) Reviewed-on: https://chromium-review.googlesource.com/817711 Commit-Queue: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
-rw-r--r--firmware/2lib/include/2common.h2
-rw-r--r--firmware/include/vb2_api.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index fa64c0f3..67032c9b 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -25,7 +25,7 @@ struct vb2_public_key;
/* Return the number of elements in an array */
#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
/* Debug output printf() for tests. Otherwise, it's platform-dependent. */
diff --git a/firmware/include/vb2_api.h b/firmware/include/vb2_api.h
index 2f63cc16..d59b6731 100644
--- a/firmware/include/vb2_api.h
+++ b/firmware/include/vb2_api.h
@@ -33,6 +33,7 @@
* TODO: Make cleaner APIs to this stuff.
*/
#ifdef NEED_VB20_INTERNALS
+#include "../2lib/include/2nvstorage.h"
#include "../2lib/include/2nvstorage_fields.h"
#include "../2lib/include/2struct.h"
#include "../lib20/include/vb2_struct.h"