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 72152D81023 for ; Tue, 7 Nov 2023 16:23:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dMzDYwtrLpcPDAF21V3/+rywaEN4MJ8npWCrA2pEOV8=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699374192; v=1; b=GEPOSeMUCZXs9SYnitHspPQnuVCXZQGsI8Ibk/g/70QPwGn5CgaQ+UEDLAxrh6WAbkPgX17X G6rBDCAC3wlijaB9JsirOxfkBm/XbGWm4rwQOYhymDmMoahIDQBOGuKsA9GZ5bAN4A3PMsnAEDf Sh6WQnU6rWGdb8pLEY/WtHdM= X-Received: by 127.0.0.2 with SMTP id ddHbYY7687511x97R8DWAUTR; Tue, 07 Nov 2023 08:23:12 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.15148.1699374191441722522 for ; Tue, 07 Nov 2023 08:23:11 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-YRugX9InMI2QAv4_9T-rtA-1; Tue, 07 Nov 2023 11:23:07 -0500 X-MC-Unique: YRugX9InMI2QAv4_9T-rtA-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3FF9185A797; Tue, 7 Nov 2023 16:23:06 +0000 (UTC) X-Received: from [10.39.193.64] (unknown [10.39.193.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED7BA2026D66; Tue, 7 Nov 2023 16:23:05 +0000 (UTC) Message-ID: <88d1e976-505d-699e-013b-43891a94eb2b@redhat.com> Date: Tue, 7 Nov 2023 17:23:04 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 2/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix MISSING_BREAK Coverity issues To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli References: <20231107061959.113213-1-rsingh@ventanamicro.com> <20231107061959.113213-3-rsingh@ventanamicro.com> From: "Laszlo Ersek" In-Reply-To: <20231107061959.113213-3-rsingh@ventanamicro.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: yMHS7til9bq9iFdrdLevmCnAx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=GEPOSeMU; 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=redhat.com (policy=none) On 11/7/23 07:19, Ranbir Singh wrote: > From: Ranbir Singh >=20 > 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 general code reader why there is no break; in > between. Adding >=20 > // No break; here as this is an intentional fallthrough. >=20 > as comment in between makes it explicit. Incidentally, the comment > satisfies Coverity as well. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 >=20 > Cc: Ray Ni > Co-authored-by: Veeresh Sangolli > Signed-off-by: Ranbir Singh > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeM= odulePkg/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 =3D PciBarTypeMe= m32; > + // > + // No break; here as this is an intentional fall throu= gh. > + // > case 64: > PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; > break; > @@ -1440,6 +1443,9 @@ UpdatePciInfo ( > switch (Ptr->AddrSpaceGranularity) { > case 32: > PciIoDevice->PciBar[BarIndex].BarType =3D PciBarTypePM= em32; > + // > + // No break; here as this is an intentional fall throu= gh. > + // > case 64: > PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; > break; Agree, but the semicolon's placement is awkward. I propose No break here, as this is an intentional fall through. Reviewed-by: Laszlo Ersek -=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 (#110863): https://edk2.groups.io/g/devel/message/110863 Mute This Topic: https://groups.io/mt/102438299/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-