[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 06/15] luks2: Rename variable i to keyslot_idx in luks2_get_ke
From: |
Glenn Washburn |
Subject: |
[PATCH v4 06/15] luks2: Rename variable i to keyslot_idx in luks2_get_keyslot. |
Date: |
Fri, 6 Nov 2020 22:44:26 -0600 |
Variables named i are usually looping variables, so rename to keyslot_idx to
allow for easier reading of luks2_get_keyslot.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/disk/luks2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c
index be42deb14..2830f83cf 100644
--- a/grub-core/disk/luks2.c
+++ b/grub-core/disk/luks2.c
@@ -255,7 +255,7 @@ luks2_parse_digest (grub_luks2_digest_t *out, const
grub_json_t *digest)
static grub_err_t
luks2_get_keyslot (grub_luks2_keyslot_t *k, grub_luks2_digest_t *d,
grub_luks2_segment_t *s,
- const grub_json_t *root, grub_size_t i)
+ const grub_json_t *root, grub_size_t keyslot_idx)
{
grub_json_t keyslots, keyslot, digests, digest, segments, segment;
grub_size_t j, size;
@@ -263,11 +263,11 @@ luks2_get_keyslot (grub_luks2_keyslot_t *k,
grub_luks2_digest_t *d, grub_luks2_s
/* Get nth keyslot */
if (grub_json_getvalue (&keyslots, root, "keyslots") ||
- grub_json_getchild (&keyslot, &keyslots, i) ||
+ grub_json_getchild (&keyslot, &keyslots, keyslot_idx) ||
grub_json_getuint64 (&idx, &keyslot, NULL) ||
grub_json_getchild (&keyslot, &keyslot, 0) ||
luks2_parse_keyslot (k, &keyslot))
- return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse keyslot
%"PRIuGRUB_SIZE, i);
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse keyslot
%"PRIuGRUB_SIZE, keyslot_idx);
/* Get digest that matches the keyslot. */
if (grub_json_getvalue (&digests, root, "digests") ||
@@ -284,7 +284,7 @@ luks2_get_keyslot (grub_luks2_keyslot_t *k,
grub_luks2_digest_t *d, grub_luks2_s
break;
}
if (j == size)
- return grub_error (GRUB_ERR_FILE_NOT_FOUND, "No digest for keyslot
%"PRIuGRUB_SIZE);
+ return grub_error (GRUB_ERR_FILE_NOT_FOUND, "No digest for keyslot
%"PRIuGRUB_SIZE, keyslot_idx);
/* Get segment that matches the digest. */
if (grub_json_getvalue (&segments, root, "segments") ||
--
2.27.0