From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mX6tx-0003AI-5e for mharc-grub-devel@gnu.org; Sun, 03 Oct 2021 15:11:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mX6tv-0003A9-FK for grub-devel@gnu.org; Sun, 03 Oct 2021 15:11:55 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mX6tt-0007W0-II for grub-devel@gnu.org; Sun, 03 Oct 2021 15:11:55 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A805A5C0045; Sun, 3 Oct 2021 15:11:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 03 Oct 2021 15:11:52 -0400 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=DHfQKI/bfojnxK3+2OQPv0Kpqqy 7k6qguH49+PmpTsg=; b=JjD7NFAK1WplFMDpEZTOGaxiQiAWDU0jNkDGmwzL2Tu YkHE+WkWsjtlgFM6lBwSeexbfh8leEv0i9SOvDLhfcMpFiK5WT7TSd2j4kBazmpk cR+mcKMfEk0xwEJdxG+2n9d+oXf/s7QfgG0jb5LxYLFHRUWnZSWeoVkNxcyRJnvP dJSifTuV5FRzSAT/YTE7Hxf0SplcBlWuED2bSLYJct4zqAsaqG+ANzdttNLqHnWH 7AWi3ibZnA7TMxCb+48JKeQJkhZgoiEgxa9SdWiZzaz5JZ4L0N1240d8OqdwmyiJ Qt5YbndRFEjTIhKfcQZyn39VMgTDXPFBhvI+JLYLdgQ== 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=DHfQKI /bfojnxK3+2OQPv0Kpqqy7k6qguH49+PmpTsg=; b=fT6hdMF9r6rskx8IBR5iPm 6Z4jeCG5YlCjRP8D+wgKxy9+KmQVjNlJu7N8He1QL47Nlb5sOM33b4SCVPcwVG3x WLoBDLYS96kllsE+fgNijdVzsdF7XPx9U1NQieTiLscUN+u0LpB6YOQf39HJRDBa E2903MJKTlHoz3cWcInP0bqgrCWk3Iwn7bX1kGtUbgPKuiSgkSO6dQ+dr26qTWqt CATs/LN34ZfP1KBxPT1K9ZZetJgG26Kdhx2wbVpVKwteeCyZBFqiRvtxFB7kS1S+ qbG31qkC3wqLlWsuYFpnJEVBHbvaZBFxbJDOSCKVHSy4F15dOECFWof6M9WmB9pg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeltddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 3 Oct 2021 15:11:51 -0400 (EDT) Received: from localhost (xps [10.192.0.12]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id f04eb2fd (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 3 Oct 2021 19:11:49 +0000 (UTC) Date: Sun, 3 Oct 2021 21:16:09 +0200 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper , Denis 'GNUtoo' Carikli , James Bottomley Subject: Re: [PATCH v2 3/4] cryptodisk: Move global variables into grub_cryptomount_args struct Message-ID: References: <20210927231403.642857-1-development@efficientek.com> <20210927231403.642857-4-development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iTug0nP/wpC7RzNg" Content-Disposition: inline In-Reply-To: <20210927231403.642857-4-development@efficientek.com> Received-SPF: pass client-ip=66.111.4.29; envelope-from=ps@pks.im; helo=out5-smtp.messagingengine.com 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_H2=-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, 03 Oct 2021 19:11:55 -0000 --iTug0nP/wpC7RzNg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 27, 2021 at 06:14:02PM -0500, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > --- > grub-core/disk/cryptodisk.c | 26 +++++++++----------------- > grub-core/disk/geli.c | 9 ++++----- > grub-core/disk/luks.c | 11 +++++------ > grub-core/disk/luks2.c | 6 +++--- > include/grub/cryptodisk.h | 6 ++++-- > 5 files changed, 25 insertions(+), 33 deletions(-) >=20 > diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c > index 86eaabe60..5e153ee0a 100644 > --- a/grub-core/disk/cryptodisk.c > +++ b/grub-core/disk/cryptodisk.c > @@ -984,9 +984,6 @@ grub_util_cryptodisk_get_uuid (grub_disk_t disk) > =20 > #endif > =20 > -static int check_boot, have_it; We should really just get rid of `have_it`. It's only used in three locations, and we only require it because `grub_cryptodisk_scan_device_real` doesn't properly tell us whether it was found or not. Using a parameter struct to pass back this value to the caller feels like a code smell, and only papers over this weird usage. Anyway, your patch doesn't make it any worse, so we may just as well fix it after this series has landed. [snip] > diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h > index 5bd970692..230167ab0 100644 > --- a/include/grub/cryptodisk.h > +++ b/include/grub/cryptodisk.h > @@ -69,6 +69,9 @@ typedef gcry_err_code_t > =20 > struct grub_cryptomount_args > { > + grub_uint32_t check_boot : 1; > + grub_uint32_t found_uuid : 1; > + char *search_uuid; > grub_uint8_t *key_data; > grub_size_t key_len; > }; Would be nice to have comments here which explain what these parameters do. for `key_data` and `key_len` it's obvious enough, but as a reader I wouldn't really know what `check_boot` ought to indicate. Patrick --iTug0nP/wpC7RzNg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAmFaAXgACgkQVbJhu7ck PpRA9g/+IgRIQ9LJppU1UQWU288Cml8LRqwJ2sf6shWNB8ubwFtaBpz48u/iDkeq UYzcqGDhOIwvz2a0oUdfqBNqZuEH+zCsK/EcMTBa/FPanR9XKdLnninG4e4cAIUU 1pLt1NpbhxWX2tNDscwLMv9jXJoNs+4MX88TSp5TUyR0ArJhZUyTlJn+c4Jkwx7Q nh4NilCFxCbX5R8s+VUEsnUcEWtV4zZ9b93G5dd0mGXVZkriUCHsTIaeM4L7gE8i IF1cb0YVyjaNPsx+STJkWpbBQV5pSsLsDMdbsqDFQaFNYCKOJrM48EBztGNtM9Ac 1zScl/f5KW8qFSqzyhch7TZnQCM9EAESaaw8d73oSnoFrYMF02mdQuCmIR9EXq9D 9Gs7jzKUQ6CRbH0X63RsqVR+6tEhIJVXjL51zAaVB30e7g4Rxa2uv4L6IOUw4Ccq /3xJVl2+maT5O6VjSQmXRNW2A9z66nGaRFyuPSAwtkOfbqzov8/nELx9V+raBq+Z hpAIulI4F1qM/+/0spsDLr6XItbvnhcx6trARY6O5ydeV4cq2ztnRrEXiV4V2nQL EsyJiCXRgrFwIQY0NWrUX+Jrk8JuS2Icnvedlcr0MQ0ISJdtLcRd7MVxiASWuWIY 68/I1ujEyJ8oGtoBsPdpMrqbngvfdxVO7vrO2BuIpIDbdtWeDi8= =OxPP -----END PGP SIGNATURE----- --iTug0nP/wpC7RzNg--