From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01BDE3EDE4D for ; Thu, 23 Jul 2026 07:59:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793542; cv=none; b=Di9zZX2/6cvxApcnXizaqE1z7Dtn5HP4USRcJIxQpfQxsHiThusjGkj7eLKRQd0glMW1ibPCZju6m9YkwW75BI7vptHyqrXVriB6DDHKkjNPZ1p0X6RGYvxfFNxV+06FQVL7ArCGRn+VMK5DWsGTvugwaqdu5eKmdI0F+fCImA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793542; c=relaxed/simple; bh=iQuhBExkXwoTed5Ff9du5z+kBL7x/In2ZB9F6nL7QuA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DDClrJYg5Xla7hjWgJ4oer+yBZPUSFr4OLxQQbf6VnraDVJ82zFzJnluHqY8mQBTpMrCccw0mHrdJensgUq4BDH9MXkKRTmMdQYHG67aYKlohC5diB84a/hgH66tcCiYni3zZwvZ/QIWSMCvT2IR+pXTokSkxUm5uAHNzBYO6ZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Drwg8wOw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Drwg8wOw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E6621F000E9; Thu, 23 Jul 2026 07:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784793540; bh=W7A6iHIAXOEMl4f8tOlEiILGykzWa6dqSRG5DnecYIY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Drwg8wOwcZUNM+iibPgobMqG/5zugnRe9iGqj+RX8mMfJWZc/Pt6xowhjCU3yGA6I Bl7hWdmeD0GSKFmf6DD3HKH5SclppHtzuihMX83a3j9FJgzLnPEXz6WsTMJwPicXqZ XSh8wMe9NZ7F3mVpeIXsx4QXhI4yfAlofZbjy3f1Q5DzVDQOFx9fnwMmtsBgy2AyM3 S9vs52w/cO0t66fThifhtmISbCul/UQSGe6Z693cllUbDcSza+vZf7NYCQ7I28QdLf dB6X14RTfrK2tugCYxFZedIGY5sCmBUFlf4JAHObKR6FXra/0bjtPl7oK4VdbwAbLH IDKwB53QWZngA== Date: Thu, 23 Jul 2026 09:58:55 +0200 From: Ingo Molnar To: Thorsten Blum Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/purgatory: Return bool from verify_sha256_digest() Message-ID: References: <20260722162245.156368-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260722162245.156368-2-thorsten.blum@linux.dev> * Thorsten Blum wrote: > - if (memcmp(digest, purgatory_sha256_digest, sizeof(digest))) > - return 1; > - > - return 0; > + return memcmp(digest, purgatory_sha256_digest, sizeof(digest)) == 0; Could you please write this as !memcmp()? The == 0 variant is quite a bad pattern for such a long line, as it's far easier to miss during review than a ! unary operator... Just like here: > + if (!verify_sha256_digest()) { Thanks, Ingo