]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2-util: drop ret_x prefix from two arguments that are not just return but also...
authorLennart Poettering <lennart@poettering.net>
Sat, 21 Dec 2024 12:09:29 +0000 (13:09 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Jan 2025 09:39:10 +0000 (10:39 +0100)
src/shared/tpm2-util.c
src/shared/tpm2-util.h

index 890d77dcc27568e26a5c50ed918d2aeda685239b..a1b2695b67290616ac7bc48785f104d8c782056f 100644 (file)
@@ -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
index 76b4dd3cc15dbaa7ba77c1d5af112d229dd0fa44..4a44c43f0f826984dabbcc76f0d522d587398418 100644 (file)
@@ -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);