From nobody Mon Sep 16 20:05:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113962+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113962+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1705527380; cv=none; d=zohomail.com; s=zohoarc; b=li706uy4HkVqQA8aZv587fs1lp+uq7JCoQzsSbTeA6UVkvDWhYItSa9gPmp5FW5ThFvIpqsMvVBmskB/6BGroioNTIz9p1cE4ausUZSu79xuQSS+yaj/hz3Zw+xriaofnJqSdxK4QC1uCBm3vqlkx6BA2IPfoXFYRjGijaZH9J4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705527380; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=GrYnccXQCBSSWbQDtccEBOon+OAPxCQCwkNfLUmtpZY=; b=PoTtyGjUj4tiWNbTibuogy+begDAiP9dS/9D9N4YNzUtqRRFEXdHEA6B+fQ4J1QXluhk0ckvBfRZtTOcBWE87W0vGe+1f+uG1V9QtR4oB96yQY8EBYrcVOJrHMdVxcQw12sBV3Ks8Sxx8UfOUMO6tKxwNR58YkLqsdr5CIOQOGI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113962+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1705527380478241.88221808066965; Wed, 17 Jan 2024 13:36:20 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=XZ0GfoPZkxOm4bC0dFZzgS5BJdsScCPFpxtJMRIiVRc=; 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=1705527380; v=1; b=myqcfrjh70XDMCBuwbJsblXyr/QGDWssrxeCDTzK7UJ0O7EmP9FOApjaY4UQoutVdJu0VfLe RCWn+aD9iIFenklmALqLQnG0VGOqvYFLYrJo011ZPnuaDPjZZM69gOUZqghDcL72/iTFCz5lj6A ShI0gpjHj8ejAh4ve9zvOlOU= X-Received: by 127.0.0.2 with SMTP id DSvZYY1788612xgNiVzb9ReB; Wed, 17 Jan 2024 13:36:20 -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: 3ZaUAltIkDK8oQOGsHJaw2BOx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527382605100013 Content-Type: text/plain; charset="utf-8" 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/Silico= n/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/Sil= icon/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 buffer)= \n", __FUNCTION__)); --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-