From 0db32a3bfb59af61aa8e79f2082dc053b9bf22d1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 21 Dec 2024 13:09:29 +0100 Subject: [PATCH] tpm2-util: drop ret_x prefix from two arguments that are not just return but also input params --- src/shared/tpm2-util.c | 12 ++++++------ src/shared/tpm2-util.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index 890d77dcc27..a1b2695b672 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -8091,14 +8091,14 @@ int tpm2_parse_pcr_argument_append(const char *arg, Tpm2PCRValue **pcr_values, s * algorithm is included in the pcr values array this results in error. This retains the previous behavior of * tpm2_parse_pcr_argument() of clearing the mask if 'arg' is empty, replacing the mask if it is set to * UINT32_MAX, and or-ing the mask otherwise. */ -int tpm2_parse_pcr_argument_to_mask(const char *arg, uint32_t *ret_mask) { +int tpm2_parse_pcr_argument_to_mask(const char *arg, uint32_t *mask) { #if HAVE_TPM2 _cleanup_free_ Tpm2PCRValue *pcr_values = NULL; size_t n_pcr_values; int r; assert(arg); - assert(ret_mask); + assert(mask); r = tpm2_parse_pcr_argument(arg, &pcr_values, &n_pcr_values); if (r < 0) @@ -8106,7 +8106,7 @@ int tpm2_parse_pcr_argument_to_mask(const char *arg, uint32_t *ret_mask) { if (n_pcr_values == 0) { /* This retains the previous behavior of clearing the mask if the arg is empty */ - *ret_mask = 0; + *mask = 0; return 0; } @@ -8123,10 +8123,10 @@ int tpm2_parse_pcr_argument_to_mask(const char *arg, uint32_t *ret_mask) { if (r < 0) return log_error_errno(r, "Could not get pcr values mask: %m"); - if (*ret_mask == UINT32_MAX) - *ret_mask = new_mask; + if (*mask == UINT32_MAX) + *mask = new_mask; else - *ret_mask |= new_mask; + *mask |= new_mask; return 0; #else diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 76b4dd3cc15..4a44c43f0f8 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -479,7 +479,7 @@ static inline bool tpm2_is_fully_supported(void) { int verb_has_tpm2_generic(bool quiet); int tpm2_parse_pcr_argument(const char *arg, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values); -int tpm2_parse_pcr_argument_append(const char *arg, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values); +int tpm2_parse_pcr_argument_append(const char *arg, Tpm2PCRValue **pcr_values, size_t *n_pcr_values); int tpm2_parse_pcr_argument_to_mask(const char *arg, uint32_t *mask); int tpm2_load_pcr_signature(const char *path, sd_json_variant **ret); -- 2.47.3