From 8280d2a77ffe72727ef1c729861231b523680dfb Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Mon, 30 Jun 2025 11:23:40 +0100 Subject: tpm: Make use of TPM2_ALG_INVAL from enum Now that the enum includes TPM2_ALG_INVAL, use that name in the code. Reviewed-by: Ilias Apalodimas Signed-off-by: Andrew Goodbody Signed-off-by: Ilias Apalodimas --- cmd/tpm-v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c index a62862e94f9..346e21d27bb 100644 --- a/cmd/tpm-v2.c +++ b/cmd/tpm-v2.c @@ -113,7 +113,7 @@ static int do_tpm2_pcr_extend(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; if (argc == 4) { algo = tpm2_name_to_algorithm(argv[3]); - if (algo < 0) + if (algo == TPM2_ALG_INVAL) return CMD_RET_FAILURE; } algo_len = tpm2_algorithm_to_len(algo); @@ -157,7 +157,7 @@ static int do_tpm_pcr_read(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; if (argc == 4) { algo = tpm2_name_to_algorithm(argv[3]); - if (algo < 0) + if (algo == TPM2_ALG_INVAL) return CMD_RET_FAILURE; } algo_len = tpm2_algorithm_to_len(algo); @@ -288,7 +288,7 @@ static int do_tpm2_pcrallocate(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; algo = tpm2_name_to_algorithm(argv[1]); - if (algo == -EINVAL) + if (algo == TPM2_ALG_INVAL) return CMD_RET_USAGE; ret = get_tpm(&dev); -- cgit v1.3.1