From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ko06d-0005ev-Fz for mharc-grub-devel@gnu.org; Sat, 12 Dec 2020 03:18:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ko06c-0005d5-9n for grub-devel@gnu.org; Sat, 12 Dec 2020 03:18:18 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:39653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ko06Q-0006V5-1O for grub-devel@gnu.org; Sat, 12 Dec 2020 03:18:18 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 95A337A0; Sat, 12 Dec 2020 03:18:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 12 Dec 2020 03:18:04 -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=Lb5CS2bk71ZvNXE1QHLFBowB+GQ pM0Xzv85GehrQfzA=; b=BaN2mmWOxMaFyJU38fcpLZKyhnsTZo6QPa2Lmyrfa0+ P3wcGVw8Xr3EpfM+/hI/2AH+FdLtRv0BSG8FHgaB1XLvU9iQqWjaLsHXpEVB/fSF TBwCT+wsTmooDjWnI18Ex/01ERRO3fA/2ZmCrd0kChXXiFaEtumn/PY+Tf375Wqm POaiSMbYjkw1QsOAoLLf/BDV9weaUDVyiRepwrh6EZCDjVh1i3rp8onMr1/HihcA AGGbKMZwmjdidh2aGr+ybn6shr5856Zt1i8nYxswqh6sr/e26R1GF7r2zLdnsE4a F3ed7biRakBTtJCsHzrTq2prmAHLM/J4n+5dIY9q50g== 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=Lb5CS2 bk71ZvNXE1QHLFBowB+GQpM0Xzv85GehrQfzA=; b=gXeIs0Gy9XAvUUgU9Uju5M VfAtsxi3n3DuKTGtkmiCEBgHerOdTUfnhMPLC89J0VmsKHi0qjgVentq7goVDl0A 6EQfMe9R6+NXlYNf02vsWHYoKRJuHB5ySTBDhlcY03/AUnDm5T7OoUDcsQU7ocCd 6phjYtktHbM+NvAGPCgHmzrRNAIKOXClXPPrJQ5uWNDjlbVHSDLR3IrKeeDBA5zp RI6QpzwCSO/w6AhcPmo9v91JfIO+QoObrVe4aHVAWtbu7eFGtqlwVFxtEe35DZx4 S9U5l9y2zhoieV2img3aOhu9Zty2tjIzphSHt77CrIGiBtJd4eka2JioOx4Ui3Zw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudekfedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfh necukfhppeejjedrudeluddruddtrdduleegnecuvehluhhsthgvrhfuihiivgepheenuc frrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail (x4dbf0ac2.dyn.telefonica.de [77.191.10.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 2958F24005C; Sat, 12 Dec 2020 03:18:03 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail (OpenSMTPD) with ESMTPSA id bc580b73 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 12 Dec 2020 08:18:02 +0000 (UTC) Date: Sat, 12 Dec 2020 09:18:01 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper , Daniel Kiper Subject: Re: [PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_size and improve readability Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SV86tzCwLfIrfnYj" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=ps@pks.im; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: Sat, 12 Dec 2020 08:18:18 -0000 --SV86tzCwLfIrfnYj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 08, 2020 at 04:45:49PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > Reviewed-by: Daniel Kiper Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index c737797b9..31b51f1d4 100644 > --- a/grub-core/disk/luks2.c > +++ b/grub-core/disk/luks2.c > @@ -642,8 +642,7 @@ luks2_recover_key (grub_disk_t source, > =20 > /* Set up disk according to keyslot's segment. */ > crypt->offset_sectors =3D grub_divmod64 (segment.offset, segment.s= ector_size, NULL); > - crypt->log_sector_size =3D sizeof (unsigned int) * 8 > - - __builtin_clz ((unsigned int) segment.sector_size) - 1; > + crypt->log_sector_size =3D grub_log2ull (segment.sector_size); > /* Set to the source disk size, which is the maximum we allow. */ > max_crypt_sectors =3D grub_disk_convert_sector(source, > source->total_sectors, > --=20 > 2.27.0 >=20 --SV86tzCwLfIrfnYj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl/UfLgACgkQVbJhu7ck PpSqcRAAow4NxwcIBPe03Ah02LAASHYZYTuue2ZS1wjYP/oOxZUTCyWRvlPIWMqs 5W/h/Uk/a9NGvx5WUZgrZd9as31BEjN1edeS2tAKilxS/uGd+GzP2IK/7yMZ68L9 KdydSArz5uZ0ZNwjymtT17/W1tYdBZ5on/DMiiDrujwk5ALRqSTfyIXvqcuPrYVM D/u72qLovZP9dBI6gXudqjIrPZEejpE4JjBWenX5JnR6/zcKhV3fsZrVVFB3u11t mz+fsTqLc2aQdTcFq6HJu4UvIXMHZNqDT8s2sswF/yK46DaPT4Rj7SHKOmgFbY/L 3n1gfwDStxvGRFkKO26kO/5zcIz8QNbfJD0zZ48G/TUHc602g5k6zhFp1iYNFo9U 85OFf2U/dF65atiNGubdg75hh2BUIOTTenDnClMfb6AmbPu5qdPB+0kI90xfuz7T /yK56tBujWmlXULvUSNcsD1/b9XlFhYhzrOMeic/xQzSWIK3dHQl58Sx4clrm4aq aGKP4dEPPrBiE5HRCGt/NZkm34TGHsCVIfRxpMOWNcHQOYh4rp1p18xC8MBKREOk 1KOGmPy5QCyujY/qBdEwy8ni+X62WJva5nl3EFWHtKdapuAqnKrL3Qvu7scOSXS8 PCKY08z193eJF4SAEjZlXqdTEoG7mXnHHDRJpEvVWPFMOcdbL6M= =jp0/ -----END PGP SIGNATURE----- --SV86tzCwLfIrfnYj--