summaryrefslogtreecommitdiff
path: root/firmware/2lib/2ec_sync.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-02-13 10:43:42 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-14 11:51:42 +0000
commit6d87e4f33f07323e791f09f4c5798978c1b5e0c8 (patch)
tree7279bc1c61a3766a27177505f55968720a031aba /firmware/2lib/2ec_sync.c
parent92af7d9f9e04b7acc6e0bea42a7482f65951ef27 (diff)
downloadvboot-6d87e4f33f07323e791f09f4c5798978c1b5e0c8.tar.gz
vboot: check for recovery mode with VB2_CONTEXT_RECOVERY_MODE
When the specific recovery reason is not needed, just use (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) to determine whether or not we are in recovery mode. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: I37f1bc066d970a51dfd7ef38cba519c00e1e764f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2053252 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/2lib/2ec_sync.c')
-rw-r--r--firmware/2lib/2ec_sync.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/firmware/2lib/2ec_sync.c b/firmware/2lib/2ec_sync.c
index 4fa0932c..684c8905 100644
--- a/firmware/2lib/2ec_sync.c
+++ b/firmware/2lib/2ec_sync.c
@@ -395,7 +395,6 @@ static int ec_will_update_slowly(struct vb2_context *ctx)
static int ec_sync_allowed(struct vb2_context *ctx)
{
- struct vb2_shared_data *sd = vb2_get_sd(ctx);
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
/* Reasons not to do sync at all */
@@ -403,7 +402,7 @@ static int ec_sync_allowed(struct vb2_context *ctx)
return 0;
if (gbb->flags & VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC)
return 0;
- if (sd->recovery_reason)
+ if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE)
return 0;
return 1;
}