diff options
author | Firas Sammoura <fsammoura@google.com> | 2023-03-16 00:39:42 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-29 23:04:43 +0000 |
commit | 70f1908a46b3ac24b29e684a49ec1cb23633019a (patch) | |
tree | f77ca61456e49a46663c16201f693b6e35d21833 /util | |
parent | 2bf2b246fad8274e4f454202d55abad3ee7f1546 (diff) | |
download | chrome-ec-70f1908a46b3ac24b29e684a49ec1cb23633019a.tar.gz |
util: Use ParseFlags to print valid flags and FP enc status
BRANCH=none
BUG=b:144959033
TEST=rm -rf build && make BOARD=host utils
Change-Id: Ia8406672ffffd4c304cb939d4fc843081f94549e
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344033
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/util/ectool.cc b/util/ectool.cc index 164494a0d4..1f67d271cc 100644 --- a/util/ectool.cc +++ b/util/ectool.cc @@ -2379,14 +2379,6 @@ int cmd_fp_info(int argc, char *argv[]) return 0; } -static void print_fp_enc_flags(const char *desc, uint32_t flags) -{ - printf("%s 0x%08x", desc, flags); - if (flags & FP_ENC_STATUS_SEED_SET) - printf(" FPTPM_seed_set"); - printf("\n"); -} - static int cmd_fp_context(int argc, char *argv[]) { struct ec_params_fp_context_v1 p; @@ -2451,10 +2443,17 @@ int cmd_fp_enc_status(int argc, char *argv[]) "FP Encryption Status returned with errors: %d\n", rv); return rv; } - print_fp_enc_flags("FPMCU encryption status:", - fp_encryptionstatus_command.GetStatus()); - print_fp_enc_flags("Valid flags: ", - fp_encryptionstatus_command.GetValidFlags()); + printf("FPMCU encryption status: 0x%08x%s", + fp_encryptionstatus_command.GetStatus(), + (ec::FpEncryptionStatusCommand::ParseFlags( + fp_encryptionstatus_command.GetStatus())) + .c_str()); + printf("Valid flags: 0x%08x%s", + fp_encryptionstatus_command.GetValidFlags(), + (ec::FpEncryptionStatusCommand::ParseFlags( + fp_encryptionstatus_command.GetValidFlags())) + .c_str()); + rv = 0; return rv; |