mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-27 11:56:03 +00:00
luks2: Rename variable "i" to "keyslot_idx" in luks2_get_keyslot()
Variables named "i" are usually looping variables. So, rename it to "keyslot_idx" to ease luks2_get_keyslot() reading. Signed-off-by: Glenn Washburn <development@efficientek.com> Reviewed-by: Patrick Steinhardt <ps@pks.im> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
c28907e235
commit
f36193ddf1
@ -255,7 +255,7 @@ luks2_parse_digest (grub_luks2_digest_t *out, const grub_json_t *digest)
|
|||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
luks2_get_keyslot (grub_luks2_keyslot_t *k, grub_luks2_digest_t *d, grub_luks2_segment_t *s,
|
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_json_t keyslots, keyslot, digests, digest, segments, segment;
|
||||||
grub_size_t j, size;
|
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 */
|
/* Get nth keyslot */
|
||||||
if (grub_json_getvalue (&keyslots, root, "keyslots") ||
|
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_getuint64 (&idx, &keyslot, NULL) ||
|
||||||
grub_json_getchild (&keyslot, &keyslot, 0) ||
|
grub_json_getchild (&keyslot, &keyslot, 0) ||
|
||||||
luks2_parse_keyslot (k, &keyslot))
|
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. */
|
/* Get digest that matches the keyslot. */
|
||||||
if (grub_json_getvalue (&digests, root, "digests") ||
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (j == size)
|
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. */
|
/* Get segment that matches the digest. */
|
||||||
if (grub_json_getvalue (&segments, root, "segments") ||
|
if (grub_json_getvalue (&segments, root, "segments") ||
|
||||||
|
Loading…
Reference in New Issue
Block a user