From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0F750D80DF6 for ; Wed, 10 Jan 2024 23:52:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ytkYHfVdWZ+2uCVLv2/Zp5HaphIy9snxeQNcPY3FXx4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704930762; v=1; b=IGb+BciFgqmrWGqtIJOEtRGyUTTkVokGGecxx+OnKX0v+dGTAKWZlhjr57VG3ZMc1WhVLgDN bj6txZNwKWGgIB1SlpY9f3UzpevQNANTeNu+ooiQxXcufnizJW+orpP4Pd9vrz8E4g0zxF4AQNM QkpNmp9ZV2Lw/C594jtc2Lhc= X-Received: by 127.0.0.2 with SMTP id V0ORYY7687511x5wwp6LJNwp; Wed, 10 Jan 2024 15:52:42 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9112.1704930760938820271 for ; Wed, 10 Jan 2024 15:52:41 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 51893106F; Wed, 10 Jan 2024 15:53:26 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E9DD3F5A1; Wed, 10 Jan 2024 15:52:40 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [PATCH 2/5] Silicon/Broadcom/BcmGenetDxe: Suppress some bogus compiler warnings Date: Wed, 10 Jan 2024 17:52:24 -0600 Message-ID: <20240110235227.2734271-3-jeremy.linton@arm.com> In-Reply-To: <20240110235227.2734271-1-jeremy.linton@arm.com> References: <20240110235227.2734271-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oeh9cZi06spY0PMSzzjkRpfMx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=IGb+BciF; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Some recent GCC revisions will throw warnings about values being used before being initialized. But in the case where the lack of initialization is the result of the called function returning error status the EFI_ERROR() macro/error seems to confuse the compiler about the fact that the value is then never used. So, while the code appears to be fine, lets just zero the variables anyway to make the compiler happy. Signed-off-by: Jeremy Linton --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c | 2 ++ Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c index 9e5d30fafd..2d5f70170e 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c @@ -381,6 +381,8 @@ GenericPhyUpdateConfig ( BOOLEAN LinkUp; Status = GenericPhyGetLinkStatus (Phy); + Speed = 0; + Duplex = 0; LinkUp = EFI_ERROR (Status) ? FALSE : TRUE; if (Phy->LinkUp != LinkUp) { diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c index 3b51a86d65..7a7c398b1f 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c @@ -731,6 +731,9 @@ GenetSimpleNetworkReceive ( UINT8 *Frame; UINTN FrameLength; + DescIndex = 0; + FrameLength = 0; + if (This == NULL || Buffer == NULL) { DEBUG ((DEBUG_ERROR, "%a: Invalid parameter (missing handle or buffer)\n", __FUNCTION__)); -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113545): https://edk2.groups.io/g/devel/message/113545 Mute This Topic: https://groups.io/mt/103652854/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-