From c0d221a348543a4b296a64239826090a167b16ed Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Tue, 6 Feb 2018 22:18:36 +0100 Subject: [PATCH] OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration "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 --- 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 1539e5b5cd..ad31b69fb0 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 )