On Fri, Nov 06, 2020 at 10:44:26PM -0600, Glenn Washburn wrote: > 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 Reviewed-by: Patrick Steinhardt > --- > 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 >