X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cmd%2Ftpm_test.c;h=35f3c96e3de7c38d4034433cf213ea4903cca116;hb=fb77a9e3537039664ad42992bef6688869eda7c1;hp=65332d11177791a7796e6bec5c38b20aa8728b6c;hpb=d82477748d641e60ba3e1a0b55d98362aed70f80;p=u-boot diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c index 65332d1117..35f3c96e3d 100644 --- a/cmd/tpm_test.c +++ b/cmd/tpm_test.c @@ -1,13 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2015 Google, Inc - * - * SPDX-License-Identifier: GPL-2.0+ */ #include #include #include -#include +#include /* Prints error and returns on failure */ #define TPM_CHECK(tpm_command) do { \ @@ -303,12 +302,12 @@ static int test_readonly(void) index_0 += 1; if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0) != TPM_SUCCESS)) { - error("\tcould not write index 0\n"); + pr_err("\tcould not write index 0\n"); } tpm_nv_write_value_lock(INDEX0); if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0)) == TPM_SUCCESS) - error("\tindex 0 is not locked\n"); + pr_err("\tindex 0 is not locked\n"); printf("\tdone\n"); return 0; @@ -471,7 +470,7 @@ static int test_write_limit(void) case TPM_MAXNVWRITES: assert(i >= TPM_MAX_NV_WRITES_NOOWNER); default: - error("\tunexpected error code %d (0x%x)\n", + pr_err("\tunexpected error code %d (0x%x)\n", result, result); } } @@ -532,15 +531,15 @@ static cmd_tbl_t cmd_cros_tpm_sub[] = { static int do_tpmtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *c; + int i; printf("argc = %d, argv = ", argc); - do { - int i = 0; - for (i = 0; i < argc; i++) - printf(" %s", argv[i]); - printf("\n------\n"); - } while (0); + for (i = 0; i < argc; i++) + printf(" %s", argv[i]); + + printf("\n------\n"); + argc--; argv++; c = find_cmd_tbl(argv[0], cmd_cros_tpm_sub,