summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-07-01 07:41:40 -0600
committerTom Rini <[email protected]>2025-07-01 07:41:40 -0600
commitcff294c74cefa2ce01cac1dd8173b61a6731642a (patch)
tree639e42a2e297feb7cd0542ad54c22c0ae85a922b /cmd
parent6c654d4b89a419469293466344553c52c2f9a736 (diff)
parent8280d2a77ffe72727ef1c729861231b523680dfb (diff)
Merge tag 'tpm-next-01072025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next
CI: https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/26897 Updates from Andrew fixing issues reported by smatch. It picked up cases of enum functions returning integers instead of enum values.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tpm-v2.c6
1 files changed, 3 insertions, 3 deletions
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);