From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1keEZm-000249-3S for mharc-grub-devel@gnu.org; Sun, 15 Nov 2020 04:44:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keEZk-00023s-D4 for grub-devel@gnu.org; Sun, 15 Nov 2020 04:44:00 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keEZi-00023g-Jb for grub-devel@gnu.org; Sun, 15 Nov 2020 04:44:00 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2BEA55C010F; Sun, 15 Nov 2020 04:43:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 15 Nov 2020 04:43:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Q7GyIJl1nElq1rWfWUgxwNVK19j Z4BLF6JRmK/IMd74=; b=moa9RtO2NMIDhTipO139HUC9CtrJTK1o11tGMBY5mhz +ZWwUhFy1kYbNaejG+eqSXWYr261ASbcJ0sXhPBJpU0mMKx3KF/Fm+z7lRLYEefd lwqkVpN/m2rN6CdoS6zokJPmyZd0R1255gpBHcZf6piYDgB8nyR71rHlcIXOuZCs wKpvOE935y7UXr/6sAyRGhebrU1X2Rs/CQUTeb7NyVx4IqPOgvyQZ/JjkT7OoNHs 180dUyvfboG4cVlzsKNu4Txk81cPFDxYL1qZJg8Cp3xK9v8XTbNV7Tj88ONr4Yp8 XVXnvn3AjUJcpUGoY/s8O1jGXrTHYnAaHkS4JKaHDqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Q7GyIJ l1nElq1rWfWUgxwNVK19jZ4BLF6JRmK/IMd74=; b=INXXIRP+jmPtw4kuGPWGIf z+Aibi7oFlom1fu8ZOy9xYLHb7JNg0/oRrH8N9WXAcE752Cw5rxTCkT2tuoEN2B6 3JvyzULJiuMs9drN27kGOzdzRjuQ4FDTwZXrNaQd11slLB0GIehBkESrAyKdyyMW 9PNm5WFZMQky1VB+WecvMoEeZpkhI978vPe+FxuX43P0q6NOxjEt+ucGwcNCNc3Z lIYtP2oLitM9y5v/C+1uS6XiWEFInzZoJ3bnX2mCGLQ3P9g6maNk26cOmPa7t+cS fm5s1XWvfPJs5JEufLRliCjvX1/Kws6gAaXD2/x8eqskeh2bnY8J4X1SVvMzQ6sg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvledgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeekrdehgedrvddurddvtdeinecuvehluhhsthgvrhfuihiivgepvdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-054-021-206.78.54.pool.telefonica.de [78.54.21.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 69F233280064; Sun, 15 Nov 2020 04:43:57 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 1aceb571 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 15 Nov 2020 09:43:56 +0000 (UTC) Date: Sun, 15 Nov 2020 10:43:55 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v4 06/15] luks2: Rename variable i to keyslot_idx in luks2_get_keyslot. Message-ID: References: <21b745c117c3681573b71a5315e26733e93fc5b0.1604723348.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jNVxmww0EXDHfD8v" Content-Disposition: inline In-Reply-To: <21b745c117c3681573b71a5315e26733e93fc5b0.1604723348.git.development@efficientek.com> Received-SPF: pass client-ip=66.111.4.27; envelope-from=ps@pks.im; helo=out3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 04:37:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2020 09:44:00 -0000 --jNVxmww0EXDHfD8v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > 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 g= rub_json_t *digest) > =20 > 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_lu= ks2_digest_t *d, grub_luks2_s > =20 > /* 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); > =20 > /* 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_luks= 2_digest_t *d, grub_luks2_s > break; > } > if (j =3D=3D 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); > =20 > /* Get segment that matches the digest. */ > if (grub_json_getvalue (&segments, root, "segments") || > --=20 > 2.27.0 >=20 --jNVxmww0EXDHfD8v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl+w+FoACgkQVbJhu7ck PpQ6qw/+J7dK7fj7mDPhgt/Koatz1G/BmT5gSI3MUXzGJwJec0bQDH1ewpH1OmfM PIBlH2ga6CCLX5+FKsp8uefq472WAmdr97tEsDKlzrAECsR0HlVvrEU/vpMKoUQN oxwPjIl9c1G+7Dy3btjp8im7ssV1nKOcLDr4avKplWnFQKRCKfWRBGLFtU8ziCFk JYuJDXgo0rb/eW7ZuRCQLu9PDXAGxr+LzTdLr6f+xgaEmLK1mTo5i3vGDJh9oAK4 /xqs0sftyrww4TQN+rv0nCNPi8/XxDVk7ZcbNyb6KzrWk9d8eOkRCD9/SvMPfsua V0otKy0mUe7KI49ymE5w0Vpgg6CXOHGraBReTys3QtaAQccy8m7BgO753C5tuLlQ czlUAEB4uSRjJVriiRsvfjJmo1dNJh8Q1OOI/Fd3owO4cIx5lmuIWYaIxveTxb9V TM50yfNyrs7mD7L/9HGA44As+4fBPlEc2errmQCdB9azu2paKF3sJWLPJTdL4IUa SR4XtkSALIMEhoXLKzllv9xe4kOVUwhv+fn350HY9oa1B5mb9eD6BJ/CpkAREfer dsVItrTYKXphmZCs+XQL6srmM8X4aFz0XnhC24RNEBgrdX2UyrQ+gS05Vm/eSdsa QpBdmeMkSsZ1QLzQXu/r+BlBXgz22cF+Q7gzlxZD2CQCpMQB2RA= =uW9/ -----END PGP SIGNATURE----- --jNVxmww0EXDHfD8v--