From: "Ranbir Singh" <rsingh@ventanamicro.com>
To: devel@edk2.groups.io, rsingh@ventanamicro.com
Cc: Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>,
Veeresh Sangolli <veeresh.sangolli@dellteam.com>
Subject: [edk2-devel] [PATCH v1 2/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix MISSING_BREAK Coverity issues
Date: Wed, 27 Sep 2023 11:46:58 +0530 [thread overview]
Message-ID: <20230927061701.451202-3-rsingh@ventanamicro.com> (raw)
In-Reply-To: <20230927061701.451202-1-rsingh@ventanamicro.com>
From: Ranbir Singh <Ranbir.Singh3@Dell.com>
The function UpdatePciInfo has switch-case code in which there are fall
through from case 32: to case 64:. While this is seeemingly intentional,
it is not evident to any static analyzer tool. Just adding
// No break; here as this is an intentional fallthrough.
as explicit comment in between makes a reader as well as Coverity happy.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4239
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Co-authored-by: Veeresh Sangolli <veeresh.sangolli@dellteam.com>
Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com>
Signed-off-by: Ranbir Singh <rsingh@ventanamicro.com>
---
MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 6594b8eae83f..eda97285ee18 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1428,6 +1428,9 @@ UpdatePciInfo (
switch (Ptr->AddrSpaceGranularity) {
case 32:
PciIoDevice->PciBar[BarIndex].BarType = PciBarTypeMem32;
+ //
+ // No break; here as this is an intentional fall through.
+ //
case 64:
PciIoDevice->PciBar[BarIndex].BarTypeFixed = TRUE;
break;
@@ -1440,6 +1443,9 @@ UpdatePciInfo (
switch (Ptr->AddrSpaceGranularity) {
case 32:
PciIoDevice->PciBar[BarIndex].BarType = PciBarTypePMem32;
+ //
+ // No break; here as this is an intentional fall through.
+ //
case 64:
PciIoDevice->PciBar[BarIndex].BarTypeFixed = TRUE;
break;
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109109): https://edk2.groups.io/g/devel/message/109109
Mute This Topic: https://groups.io/mt/101612808/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-09-27 6:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 6:16 [edk2-devel] [PATCH v1 0/5] BZ 4239: Fix PciBusDxe issues pointed by Ranbir Singh
2023-09-27 6:16 ` [edk2-devel] [PATCH v1 1/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix DEADCODE Coverity issue Ranbir Singh
2023-09-27 6:16 ` Ranbir Singh [this message]
2023-09-27 6:16 ` [edk2-devel] [PATCH v1 3/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix ARRAY_VS_SINGLETON Coverity issues Ranbir Singh
2023-09-27 6:17 ` [edk2-devel] [PATCH v1 4/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix NULL_RETURNS Coverity issue Ranbir Singh
2023-09-27 6:17 ` [edk2-devel] [PATCH v1 5/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix UNUSED_VALUE Coverity issues Ranbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230927061701.451202-3-rsingh@ventanamicro.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox