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 7E076D80F9A for ; Tue, 7 Nov 2023 15:49:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lG6Nk8qfDlSYbUQCVlwqH4nsTaUgglyCclc2hfMmJKU=; 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=1699372191; v=1; b=bl8IDsWAN5ls6LV5Zm31ePfdZoX9rnNTOeByZ1pY671DpG24jReHuj/8OcmNaTSdLgds4nxS lfI/+qSzTq0czR62bh35rca2A9gVGVUFFmEcLcmks4gsiUvfYatOBPTw/Wh+BPctDo4Rn1EK8C4 v8KHQDG4DNDi1fziV21GbMBw= X-Received: by 127.0.0.2 with SMTP id 4RWIYY7687511xNDF9vZL1Ng; Tue, 07 Nov 2023 07:49:51 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.14181.1699372190184979702 for ; Tue, 07 Nov 2023 07:49:50 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-vMH7Lc-aNtWgD2JVhbJKIg-1; Tue, 07 Nov 2023 10:49:46 -0500 X-MC-Unique: vMH7Lc-aNtWgD2JVhbJKIg-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 B69193C1CC52; Tue, 7 Nov 2023 15:49:45 +0000 (UTC) X-Received: from [10.39.193.64] (unknown [10.39.193.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C9CD492BFC; Tue, 7 Nov 2023 15:49:44 +0000 (UTC) Message-ID: Date: Tue, 7 Nov 2023 16:49:43 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 2/2] MdeModulePkg/Bus/Pci/PciHostBridgeDxe: Fix MISSING_BREAK Coverity issue To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli References: <20231107050647.59613-1-rsingh@ventanamicro.com> <20231107050647.59613-3-rsingh@ventanamicro.com> From: "Laszlo Ersek" In-Reply-To: <20231107050647.59613-3-rsingh@ventanamicro.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: Dx3bQ6oyreXnGZZEJXdQs9Cex7686176AA= 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=bl8IDsWA; 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 06:06, Ranbir Singh wrote: > From: Ranbir Singh >=20 > The function SubmitResources has a switch-case code in which the > case ACPI_ADDRESS_SPACE_TYPE_MEM: which falls through to > case ACPI_ADDRESS_SPACE_TYPE_IO: if there is no scenario of > return EFI_INVALID_PARAMETER; >=20 > While this may be 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=3D4212 >=20 > Cc: Ray Ni > Co-authored-by: Veeresh Sangolli > Signed-off-by: Ranbir Singh > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeM= odulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > index 519e1369f85e..3bd91e2787fd 100644 > --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > @@ -1531,6 +1531,10 @@ SubmitResources ( > return EFI_INVALID_PARAMETER; > } > =20 > + // > + // No break; here as this is an intentional fall through. > + // > + > case ACPI_ADDRESS_SPACE_TYPE_IO: > // > // Check aligment, it should be of the form 2^n-1 I agree with adding the comment (I agree it's a fallthrough), but the semicolon is weird. I think we should say: No break here, as this is an intentional fall through. Laszlo -=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 (#110857): https://edk2.groups.io/g/devel/message/110857 Mute This Topic: https://groups.io/mt/102437649/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-