[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 07/15] luks2: Rename index variable j to i.
From: |
Glenn Washburn |
Subject: |
[PATCH v4 07/15] luks2: Rename index variable j to i. |
Date: |
Fri, 6 Nov 2020 22:44:27 -0600 |
Looping variable j was named such because the variable name i was taken.
Since i has been renamed in the previous patch, we can rename j to i.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/disk/luks2.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c
index 2830f83cf..d96764a02 100644
--- a/grub-core/disk/luks2.c
+++ b/grub-core/disk/luks2.c
@@ -258,7 +258,7 @@ luks2_get_keyslot (grub_luks2_keyslot_t *k,
grub_luks2_digest_t *d, grub_luks2_s
const grub_json_t *root, grub_size_t keyslot_idx)
{
grub_json_t keyslots, keyslot, digests, digest, segments, segment;
- grub_size_t j, size;
+ grub_size_t i, size;
grub_uint64_t idx;
/* Get nth keyslot */
@@ -273,35 +273,35 @@ luks2_get_keyslot (grub_luks2_keyslot_t *k,
grub_luks2_digest_t *d, grub_luks2_s
if (grub_json_getvalue (&digests, root, "digests") ||
grub_json_getsize (&size, &digests))
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not get digests");
- for (j = 0; j < size; j++)
+ for (i = 0; i < size; i++)
{
- if (grub_json_getchild (&digest, &digests, j) ||
+ if (grub_json_getchild (&digest, &digests, i) ||
grub_json_getchild (&digest, &digest, 0) ||
luks2_parse_digest (d, &digest))
- return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse digest
%"PRIuGRUB_SIZE, j);
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse digest
%"PRIuGRUB_SIZE, i);
if ((d->keyslots & (1 << idx)))
break;
}
- if (j == size)
+ if (i == 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") ||
grub_json_getsize (&size, &segments))
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not get segments");
- for (j = 0; j < size; j++)
+ for (i = 0; i < size; i++)
{
- if (grub_json_getchild (&segment, &segments, j) ||
+ if (grub_json_getchild (&segment, &segments, i) ||
grub_json_getuint64 (&idx, &segment, NULL) ||
grub_json_getchild (&segment, &segment, 0) ||
luks2_parse_segment (s, &segment))
- return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse segment
%"PRIuGRUB_SIZE, j);
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Could not parse segment
%"PRIuGRUB_SIZE, i);
if ((d->segments & (1 << idx)))
break;
}
- if (j == size)
+ if (i == size)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "No segment for digest
%"PRIuGRUB_SIZE);
return GRUB_ERR_NONE;
--
2.27.0
- [PATCH v4 03/15] luks2: Rename source disk variabled named 'disk' to 'source' as in luks.c., (continued)
- [PATCH v4 05/15] luks2: Use correct index variable when looping in luks2_get_keyslot., Glenn Washburn, 2020/11/06
- [PATCH v4 07/15] luks2: Rename index variable j to i.,
Glenn Washburn <=
- [PATCH v4 09/15] luks2: Improve error messages in luks2_get_keyslot., Glenn Washburn, 2020/11/06
- [PATCH v4 10/15] luks2: Use more intuitive keyslot key instead of index when naming keyslot., Glenn Washburn, 2020/11/06
- [PATCH v4 11/15] cryptodisk: Replace some literals with constants in grub_cryptodisk_endecrypt., Glenn Washburn, 2020/11/06