From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A4DCA222DE13B for ; Wed, 7 Feb 2018 14:38:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A850EC0587CA; Wed, 7 Feb 2018 22:44:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-123.phx2.redhat.com [10.3.117.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D4455D6A8; Wed, 7 Feb 2018 22:44:42 +0000 (UTC) From: Laszlo Ersek To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Brijesh Singh , Jordan Justen Date: Wed, 7 Feb 2018 23:44:35 +0100 Message-Id: <20180207224435.10730-3-lersek@redhat.com> In-Reply-To: <20180207224435.10730-1-lersek@redhat.com> References: <20180207224435.10730-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 07 Feb 2018 22:44:43 +0000 (UTC) Subject: [PATCH v2 2/2] OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 22:38:59 -0000 "Platform.h" declares the AmdSevInitialize() function without EFIAPI, but the definition in "AmdSev.c" includes EFIAPI. GCC toolchains without LTO do not catch this error because "AmdSev.c" does not include "Platform.h"; i.e. the declaration used by callers such as "Platform.c" is not actually matched against the function definition at build time. With LTO enabled, the mismatch is found -- however, as a warning only, due to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for now", 2016-08-03). Include the header in the C file (which turns the issue into a hard build error on all GCC toolchains), plus sync the declaration from the header file to the C file. There's been no functional breakage because AmdSevInitialize() takes no parameters. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Fixes: 13b5d743c87a22dfcd94e8475d943dee5712b62d Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Brijesh Singh Reviewed-by: Jaben Carsey Acked-by: Ard Biesheuvel --- Notes: v2: - no code changes, just pick up feedback tags - add "Fixes:" tag to the commit message OvmfPkg/PlatformPei/AmdSev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 1539e5b5cdce..ad31b69fb032 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -23,6 +23,8 @@ #include #include +#include "Platform.h" + /** Function checks if SEV support is available, if present then it sets @@ -30,7 +32,6 @@ **/ VOID -EFIAPI AmdSevInitialize ( VOID ) -- 2.14.1.3.gb7cf6e02401b