The function tpm2_name_to_algorithm attempts to return -EINVAL for an error but that is not included in the enum tpm2_algorithms which is defined as the return type for this function. Add -EINVAL as TPM2_ALG_INVAL to the enum so that it can be returned as desired. Update the code to use this enum value.
Signed-off-by: Andrew Goodbody <andrew.goodb...@linaro.org> --- Changes in v3: - Rework first patch to have the header file include errno.h instead of the individual files - Link to v2: https://lore.kernel.org/r/20250625-tpm_enum-v2-0-ea3f84f6b...@linaro.org Changes in v2: - Add patch to make use of new enum value TPM2_ALG_INVAL - Link to v1: https://lore.kernel.org/r/20250625-tpm_enum-v1-1-73a1aff0b...@linaro.org --- Andrew Goodbody (2): cmd: tpm: Fix attempt to return value not in enum tpm: Make use of TPM2_ALG_INVAL from enum cmd/tpm-v2.c | 6 +++--- include/tpm-v2.h | 2 ++ lib/tpm-v2.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) --- base-commit: 903eb123236ccbd8ef05d43507a2a910b785bd56 change-id: 20250625-tpm_enum-098ee9a5eb6b Best regards, -- Andrew Goodbody <andrew.goodb...@linaro.org>