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 4FD4B941C69 for ; Wed, 17 Jan 2024 21:36:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=azJjwo++XcFqoo8pwSi92NrMyCeUrJbIZ00I8BLFbp8=; 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=1705527381; v=1; b=ALm2gwlQS2tRL4s4cFey/n/IFZbO+nYmKV0nxGP9hHhR8/c+IyzonqIoPqjB4vkp2gL+ao2I Vd6tUM9f/RmvHatEPoLa3Mlbb6lmOvZH727179MdOLfoEzUHBWJKBi/JOsKj5N0xv1nQ0djwSmZ 1GkvZlavK3dA3Ho5hvt4YOeM= X-Received: by 127.0.0.2 with SMTP id NbL7YY7687511xj6qD412Xjk; Wed, 17 Jan 2024 13:36:21 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.628.1705527379109716188 for ; Wed, 17 Jan 2024 13:36:19 -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 9119215DB; Wed, 17 Jan 2024 13:37:04 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [10.119.39.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E5D23F73F; Wed, 17 Jan 2024 13:36:18 -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 v2 2/5] Silicon/Broadcom/BcmGenetDxe: Suppress some bogus compiler warnings Date: Wed, 17 Jan 2024 15:36:11 -0600 Message-ID: <20240117213614.4188518-3-jeremy.linton@arm.com> In-Reply-To: <20240117213614.4188518-1-jeremy.linton@arm.com> References: <20240117213614.4188518-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: dSdY6W7jg5nuaBVmztp1UzcQx7686176AA= 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=ALm2gwlQ; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Some recent GCC revisions will throw warnings about values being used before being initialized. But in the case where the lack of initializatio= n 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/Sili= con/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; =20 Status =3D GenericPhyGetLinkStatus (Phy); + Speed =3D 0; + Duplex =3D 0; LinkUp =3D EFI_ERROR (Status) ? FALSE : TRUE; =20 if (Phy->LinkUp !=3D LinkUp) { diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c b/S= ilicon/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; =20 + DescIndex =3D 0; + FrameLength =3D 0; + if (This =3D=3D NULL || Buffer =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "%a: Invalid parameter (missing handle or buffe= r)\n", __FUNCTION__)); --=20 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113962): https://edk2.groups.io/g/devel/message/113962 Mute This Topic: https://groups.io/mt/103796308/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-