mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
Updates from Andrew fixing issues reported by smatch.
It picked up cases of enum functions returning integers instead of enum values. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmhjduEACgkQgS8AYozs +qIjhg//cgv87VdzLYJQw1ej9p1f7ITQNuRsGybmo5jVcOy1/WKhgvK4ylhh6U5I xSSqa7pmdy1TnZsuJrtWafEwTu8kvOGsnXCLM1tMc0qJjspSo7FiVivkYt0H0wC8 TctzU1iFLk7yPv6lhErc+UAmceR/siiWeeXlRvXL4Z9tiKTKMDUar+tQr1p1G6DY q1atKWiFKyGFHEKenBMTRc9vHyW6L4UzTWq6ex44pHqJyabvmmmS55eUX7M+G6js 3IIT07nlSkjRLvD3W2XjwS07/H5ucvtdIO7Uve4kRY9JpfaacwLF9u4WrdTRpNB3 YmHkkIIfmZTuPwyTtYvYlVMweSoLPTPXh0ujghkmgNaSRvxt59cgffMQEA5lxFj1 9turTY+5ERvcVsD6ZtJtWorxvPXpgXeKx33OKf35r9o1YhS33PL7ynxHvHqtpkY+ xi0e5REwWlmU0QqAOcpOovNj4sEqmg9IHJw3aa0csuCmL97deT43LFsVv6K5hwpZ EakYjxDGt1hFLIyKOu0yd3uVp/lryERrz/0mJUcMwU5bNnhLqYIHwFejLdu0DTl6 nPHUyLXNUGTwGCuZZbuinQSjT0+nwDSddghTIBurMJJR1cfIsIpBTXRYrXaUNaxY gAxvaSENf3vJja6dtSlVp+tH3B7RWRIZnqCV88CGsIxk3qEh4RE= =v/2a -----END PGP SIGNATURE----- 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.
This commit is contained in:
commit
cff294c74c
@ -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);
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#define __TPM_V2_H
|
||||
|
||||
#include <tpm-common.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
struct udevice;
|
||||
|
||||
@ -266,6 +267,7 @@ enum tpm2_return_codes {
|
||||
* TPM2 algorithms.
|
||||
*/
|
||||
enum tpm2_algorithms {
|
||||
TPM2_ALG_INVAL = -EINVAL,
|
||||
TPM2_ALG_SHA1 = 0x04,
|
||||
TPM2_ALG_XOR = 0x0A,
|
||||
TPM2_ALG_SHA256 = 0x0B,
|
||||
|
||||
@ -1141,7 +1141,7 @@ enum tpm2_algorithms tpm2_name_to_algorithm(const char *name)
|
||||
}
|
||||
printf("%s: unsupported algorithm %s\n", __func__, name);
|
||||
|
||||
return -EINVAL;
|
||||
return TPM2_ALG_INVAL;
|
||||
}
|
||||
|
||||
const char *tpm2_algorithm_name(enum tpm2_algorithms algo)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user