From nobody Sat Apr 20 11:46:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56263+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56263+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1585128820; cv=none; d=zohomail.com; s=zohoarc; b=dSLOHLtDbJE0CPHzjI4en1w6+NM7M+KWTKYehz0Z4o8b5aFvf8DMAdtpGNmbFio8IqlJBagiIGpZv9dIe/63pRojEHBEM/r78Ato0r+kOVrhsxmVS/Nt1k8pvL+21n52dZbsAmNVZBY+oiZSqxW7QdSjYzmO5B41tS7/xW5sfIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585128820; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=OutFg3vT5GlWFJpDduExY0BLf6XZ01Yjc3zMpbvY1dY=; b=C+t9r8o3d8+l69K0xku+V0d7FBLtQVdg7EAKlfhyTgavwaBQ40eaQB9VUrg0dyKqhdBvWkMg8IJyXzGUd7tfJqOSFJ1xnD8e132BH56Oc0hM4sCJLkbV6N7Ak178ow7M6HakufqZlcB8HSCKXJ8WK8WpZ8190WjBYy9UY+CL4V4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56263+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585128820639146.3095473813579; Wed, 25 Mar 2020 02:33:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bO9HYY1788612xOVREqJWMhU; Wed, 25 Mar 2020 02:33:40 -0700 X-Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web11.7764.1585128819268382172 for ; Wed, 25 Mar 2020 02:33:39 -0700 X-Received: by mail-wm1-f65.google.com with SMTP id b12so1543965wmj.3 for ; Wed, 25 Mar 2020 02:33:39 -0700 (PDT) X-Gm-Message-State: wbREATiZ6uZjmMw6WitznJRUx1787277AA= X-Google-Smtp-Source: ADFU+vtYKVC1gZK9VO0aQPXyfFbII8kPUX1m3gnXBazeI0PKWsMhzLX1VTjK2vx1XA7nv4GOcvShtg== X-Received: by 2002:a05:600c:2316:: with SMTP id 22mr2574513wmo.79.1585128816909; Wed, 25 Mar 2020 02:33:36 -0700 (PDT) X-Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr. [109.210.65.247]) by smtp.gmail.com with ESMTPSA id z12sm34444365wrt.27.2020.03.25.02.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 02:33:36 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH] ArmVirtPkg/PlatformPeiLib: add dummy assignment to work around older GCC Date: Wed, 25 Mar 2020 10:33:34 +0100 Message-Id: <20200325093334.24793-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ard.biesheuvel@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585128820; bh=ovbZdrghJeQTLtUp4Ln68s0YB5ZMrrTh+qV1UK2LqIk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=DYKw4/kjB3j9IGjPEdfx+e8VEiZ1Eq/s+3V98ioetBiO05j+OWDH1pexCyKlH7nnGCK Va7/OMxkNT+4IbTvpWvXu/flfRSgdj6/+bwHxusw1axuVdeyqDpl5B8fU8r148zkHcSdq +dwW15oA4d+K87wf3HSaVEiUPNZeXXqNlHY= X-ZohoMail-DKIM: pass (identity @groups.io) Older GCC (<=3D 4.9) fail to infer that Parent is never used unless it has been assigned before, and may throw an error like /work/git/edk2/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c: In function =E2=80=98PlatformPeim=E2=80=99: /work/git/edk2/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c:132:24: error: =E2=80=98Parent=E2=80=99 may be used uninitialized in this fun= ction [-Werror=3Dmaybe-uninitiali= zed] RangesProp =3D fdt_getprop (Base, Parent, "ranges", &RangesLen= ); Set Parent to 0 at the start of the sequence to work around this. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2601 Fixes: 82662a3b5f56e974 ("ArmVirtPkg/PlatformPeiLib: discover the TPM base = ...") Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c b/ArmVirtPk= g/Library/PlatformPeiLib/PlatformPeiLib.c index 8b5b3dd5dc1c..6c4028e17995 100644 --- a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c +++ b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c @@ -77,6 +77,11 @@ PlatformPeim ( =20 TpmBase =3D 0; =20 + // + // Set Parent to suppress incorrect compiler/analyzer warnings. + // + Parent =3D 0; + for (Prev =3D Depth =3D 0;; Prev =3D Node) { Node =3D fdt_next_node (Base, Prev, &Depth); if (Node < 0) { --=20 2.17.1 -=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 (#56263): https://edk2.groups.io/g/devel/message/56263 Mute This Topic: https://groups.io/mt/72537259/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-