From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web11.11362.1598708481547784971 for ; Sat, 29 Aug 2020 06:41:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=IqzaHar8; spf=pass (domain: nuviainc.com, ip: 209.85.128.68, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f68.google.com with SMTP id w2so1603265wmi.1 for ; Sat, 29 Aug 2020 06:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gcrgD6CGr2uNExVZVY0Agmm1JN/iktw8wmCSTDWxd3o=; b=IqzaHar8yux53RxePQCO969cucy0WbJcXC1CRnFunS4SVwAXZMrogvc4BK2uiMTyX2 KdznIA0K3pIdnOQD7A8zl4S+6R4/uk357mZsXIE3J94eGbPS8LdP5CIBjxjSezVRG/GI UAF3RzrXTrJuCE6j9+2hrKgJ6Hv37ISy+fLrC3snYiRjEirHbAAhP4tlngWJumOSV/aN F+IOkFC6mpX9RaB9vF0QgkUsjtFybjucSATg9vFuOGL9ICL0/RSodn06tC3guOzjGxXm viwPsKNxnLRyZMbz8XS9zzco14Z8Lji4wswJgRTxB2NexwrZjHOi0gEssvB+dJR7Xu+h t5vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gcrgD6CGr2uNExVZVY0Agmm1JN/iktw8wmCSTDWxd3o=; b=eb9isdIXQZtR7a9FqgNeRlt/pC513f2K3dmgPD0wVri7PJGoQEAzDlrnxRIo9t+G+K wZj9ZjcmC8eSensnbFt04+7FuPzMEEyYWL0qKj6kc0tsq7AFU7nOYY3nzNsqzfU1zY7s Eq2MpF6Qk683phd85jn8Z4NmLXgJxFJvNZAu9R3eW+gFRDztLuMwpWKMzefzc7vpYGzo orZx3x9HshCBBKT5VimzrXHoSF9erV880T6zNvNsrYi4IQ5pRdqKiq6uArT1LOB6M6Mv IRPajj9I62cvXGmyM0knOFEkzqJPK6Wnk+LJcbN1LD18GZBuraWPcpyrbiBmSpVY943u fOUw== X-Gm-Message-State: AOAM531ueB+DIIxWxCR6Yiae4DGDAYzQrEiPDVUmbiR4t9+qMia6G7+G 0MWWlt5sh+KVNMDtxk5+JO6HUuseZgX+3DphAA8ow3kgZs4LrJ2frjZDz21baBtmEJEOTib10mL 9i9yy9pKgfPX2+hUvtWObbZ1fDkk5NOcRuvfjcZ2X+j/NYMHVcaQiCLyP5BubJ7hrSH1w X-Google-Smtp-Source: ABdhPJwHDBRRQwA+6wuDqBNbOMkYygGnJJ4JdvF/aBkNlTB/WAsXt1WnmHy/1Lujf/wpUmLXmGb0lA== X-Received: by 2002:a7b:c5cf:: with SMTP id n15mr3228927wmk.93.1598708479611; Sat, 29 Aug 2020 06:41:19 -0700 (PDT) Return-Path: Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id y24sm3268904wmi.17.2020.08.29.06.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 06:41:19 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Abner Chang , Gilbert Chen , Daniel Schaefer Subject: [PATCH edk2-platforms 1/1] Silicon/SiFive: fix RELEASE builds of U54 PeiCoreInfoHobLib Date: Sat, 29 Aug 2020 14:41:18 +0100 Message-Id: <20200829134118.19610-1-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In function CreateU54E51CoreProcessorSpecificDataHob(), the FirmwareContext variable gets initialized an ASSERT_EFI_ERROR macro, meaning the initialization gets folded out for RELEASE builds. Use a temporary variable for the ASSERT instead. Fixes a build error of both u540 and u500 with gcc 8.3. Cc: Abner Chang Cc: Gilbert Chen Cc: Daniel Schaefer Signed-off-by: Leif Lindholm --- Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c b/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c index 6ddae632fd17..edeabf028ff8 100644 --- a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c +++ b/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c @@ -56,6 +56,7 @@ CreateU54E51CoreProcessorSpecificDataHob ( RISC_V_PROCESSOR_SPECIFIC_HOB_DATA ProcessorSpecDataHob; EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific; + EFI_STATUS Status; DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__)); @@ -63,7 +64,8 @@ CreateU54E51CoreProcessorSpecificDataHob ( return EFI_INVALID_PARAMETER; } - ASSERT_EFI_ERROR (SbiGetFirmwareContext (&FirmwareContext)); + Status = SbiGetFirmwareContext (&FirmwareContext); + ASSERT_EFI_ERROR (Status); DEBUG ((DEBUG_INFO, " Firmware Context is at 0x%x.\n", FirmwareContext)); FirmwareContextHartSpecific = FirmwareContext->HartSpecific[HartId]; DEBUG ((DEBUG_INFO, " Firmware Context Hart specific is at 0x%x.\n", FirmwareContextHartSpecific)); -- 2.20.1