summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-05-07 12:56:19 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-10 10:43:55 -0700
commitdac763c782ce05476dec02e855f349d2b6f3a910 (patch)
tree71c6d4a72c811430782f8b293954a51d511d056a /firmware
parentad546b47f698ef1bd4ec26cbd157334f61b50958 (diff)
downloadvboot-dac763c782ce05476dec02e855f349d2b6f3a910.tar.gz
Make vboot -Wtype-limits compliantstabilize-12202.B
-Wtype-limits is an additional warning we're trying to enable in coreboot that catches common coding mistakes (e.g. checking whether an unsigned variable is < 0). vboot almost works with this out of the box, but there's one instance where we want such a check (because the constant it's checking may change). This patch pragma's it out so that we can still build with the new warning. BRANCH=None BUG=chromium:960270 TEST=make runtests Change-Id: I678a5915c99451b7e0a2672efb5ae6c81ebfb027 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1598720 Commit-Ready: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 95cbae35..8b6a19f8 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -117,6 +117,9 @@ void vb2_fail(struct vb2_context *ctx, uint8_t reason, uint8_t subcode)
}
}
+#pragma GCC diagnostic push
+/* Don't warn for the version_minor check even if the checked version is 0. */
+#pragma GCC diagnostic ignored "-Wtype-limits"
int vb2_init_context(struct vb2_context *ctx)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
@@ -152,6 +155,7 @@ int vb2_init_context(struct vb2_context *ctx)
ctx->workbuf_used = vb2_wb_round_up(sizeof(*sd));
return VB2_SUCCESS;
}
+#pragma GCC diagnostic pop
void vb2_check_recovery(struct vb2_context *ctx)
{