Make vboot -Wtype-limits compliant

-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>
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 95cbae3..8b6a19f 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -117,6 +117,9 @@
 	}
 }
 
+#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 @@
 	ctx->workbuf_used = vb2_wb_round_up(sizeof(*sd));
 	return VB2_SUCCESS;
 }
+#pragma GCC diagnostic pop
 
 void vb2_check_recovery(struct vb2_context *ctx)
 {