summaryrefslogtreecommitdiff
path: root/firmware/2lib/2misc.c
diff options
context:
space:
mode:
authoredisonhello <edisonhello@google.com>2021-08-02 14:28:50 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-12 08:13:14 +0000
commit51879dc24aea94851fc28ffc2f68cba1b58f3db8 (patch)
tree832355c3b26b424b9300c92a9fb2a6b93f28e4c6 /firmware/2lib/2misc.c
parentd8de9942e2fdfdf3f1792740cb5419163faff3ea (diff)
downloadvboot-51879dc24aea94851fc28ffc2f68cba1b58f3db8.tar.gz
Since all flags are initialized as 0 in vb2api_init(), some flag unset operations are not needed. Edit few comments to make it more accurate. BUG=none TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1; \ make -j32 test_setup && make -j32 runtests; BRANCH=none Signed-off-by: edisonhello <edisonhello@google.com> Change-Id: I0129f43342598195800ff671b965100d3d568564 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3066803 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware/2lib/2misc.c')
-rw-r--r--firmware/2lib/2misc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 03766b44..efa33a8a 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -579,10 +579,9 @@ void vb2_fill_dev_boot_flags(struct vb2_context *ctx)
{
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
- if (vb2_secdata_fwmp_get_flag(ctx, VB2_SECDATA_FWMP_DEV_DISABLE_BOOT) &&
- !(gbb->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON))
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALLOWED;
- else
+ if (!vb2_secdata_fwmp_get_flag(ctx,
+ VB2_SECDATA_FWMP_DEV_DISABLE_BOOT) ||
+ (gbb->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALLOWED;
if (vb2_nv_get(ctx, VB2_NV_DEV_BOOT_EXTERNAL) ||
@@ -590,15 +589,11 @@ void vb2_fill_dev_boot_flags(struct vb2_context *ctx)
vb2_secdata_fwmp_get_flag(ctx,
VB2_SECDATA_FWMP_DEV_ENABLE_EXTERNAL))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED;
- else
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED;
if (vb2_nv_get(ctx, VB2_NV_DEV_BOOT_ALTFW) ||
(gbb->flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_ALTFW) ||
vb2_secdata_fwmp_get_flag(ctx, VB2_SECDATA_FWMP_DEV_ENABLE_ALTFW))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
- else
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
}
int vb2api_use_short_dev_screen_delay(struct vb2_context *ctx)