From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ACDCC77B7F for ; Tue, 9 May 2023 00:51:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjEIAvp (ORCPT ); Mon, 8 May 2023 20:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjEIAvo (ORCPT ); Mon, 8 May 2023 20:51:44 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6FF4C02; Mon, 8 May 2023 17:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683593503; x=1715129503; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=aHvbnWtDWpjYKd+xoWbeYChlxEJai6bgi54+BgIawTs=; b=QQ0O82ZE9WAtcvGfBJVpd8kQaXh6LmLoaLpg0AaeBsRAffKZtmN1b9bt VzjvMAToXJw76waLM3qt8Cfx9CXsYYEhSZGmnB9uy0ApeXcpFT2CjTUWP uPmnr6gJMlTm/4mfQyT8bkM8/S1rzUjrOHTgDkFtJ2CNCizkHNmQ3bM55 qBkievATMZ8pw3YUW4W+lJ5TYgCPieFoyD2MP3stTiVGK9dV9ELUA9zM8 9kJptK8EuGD/TICz/5n83f8Jz5KFEU0166btsFLMkro/zFeg1+uBUs4to nZoAK4RAD5YUIu4UzGOao6L25jR6W/MKJVw86NbKbbO/2xjuYYXU3lBT/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="377879137" X-IronPort-AV: E=Sophos;i="5.99,259,1677571200"; d="scan'208";a="377879137" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 17:51:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="842901610" X-IronPort-AV: E=Sophos;i="5.99,259,1677571200"; d="scan'208";a="842901610" Received: from ahdamali-mobl.amr.corp.intel.com (HELO [10.212.29.166]) ([10.212.29.166]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 17:51:42 -0700 Message-ID: <5652406b-1764-ee02-d76f-c2c7ab66d213@intel.com> Date: Mon, 8 May 2023 17:51:41 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v6 07/12] x86/cpu/keylocker: Load an internal wrapping key at boot-time Content-Language: en-US To: "Chang S. Bae" , Eric Biggers Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, dm-devel@redhat.com, gmazyland@gmail.com, luto@kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de, mingo@kernel.org, x86@kernel.org, herbert@gondor.apana.org.au, ardb@kernel.org, dan.j.williams@intel.com, bernie.keany@intel.com, charishma1.gairuboyina@intel.com, lalithambika.krishnakumar@intel.com, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" References: <20220112211258.21115-1-chang.seok.bae@intel.com> <20230410225936.8940-1-chang.seok.bae@intel.com> <20230410225936.8940-8-chang.seok.bae@intel.com> <1b2eb485-2320-b33b-a0ac-53f7cb170adc@intel.com> <8748511c-cf9a-f3ce-e560-d0646dc3d108@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/8/23 17:31, Chang S. Bae wrote: >> With the macro, they'll get no type warning.  The inline actually makes >> it easier to find bugs because folks will get _some_ type checking no >> matter how they compile the code. > > Ah, when the prototype with one or more arguments, 'static inline' > allows the check. Then it is not an 'either-way' thing. > > Looking at the x86 code, there are some seemingly related: > > $ git grep "do { } while (0)" arch/x86 | grep -v "()" ... Right. It's not a hard and fast rule. We certainly take code either way and there can be real reasons to do it one way versus the other.