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 AAB3E74004E for ; Mon, 9 Oct 2023 11:47:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=KbElYdqiKW8E82g171oAsLbTdP74J7i+K6UtsROkucA=; 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=1696852043; v=1; b=o0JL1Hp0R7sKpIUh8JK+X1+nb7Ue/UbH1hKtTMTx2tjdIOxyDRSJVJ3G419XKyqM94mL7rsl DItAlvKG7wCufu2TuSp1VRmltWSCIdPjuq/YeMekwjFrI7l+6h+H5r/CkGAayChBYk4QxMPtptq Fgfu9LA5IYSYbOUWUg/EqwCg= X-Received: by 127.0.0.2 with SMTP id DEqcYY7687511xwurX4KUXeT; Mon, 09 Oct 2023 04:47:23 -0700 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.web10.59517.1696852042592464973 for ; Mon, 09 Oct 2023 04:47:22 -0700 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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-A3uXPynBNzW421Hl46i-9Q-1; Mon, 09 Oct 2023 07:47:18 -0400 X-MC-Unique: A3uXPynBNzW421Hl46i-9Q-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E52981D79F; Mon, 9 Oct 2023 11:47:18 +0000 (UTC) X-Received: from [10.39.192.114] (unknown [10.39.192.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5E61C0FE2E; Mon, 9 Oct 2023 11:47:17 +0000 (UTC) Message-ID: <0244607d-90d3-811e-80f5-afaa861b3b0b@redhat.com> Date: Mon, 9 Oct 2023 13:47:16 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni References: <20231009112832.225861-1-rsingh@ventanamicro.com> <20231009112832.225861-3-rsingh@ventanamicro.com> From: "Laszlo Ersek" In-Reply-To: <20231009112832.225861-3-rsingh@ventanamicro.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: 6itG9TuRnWKLM1knCtcWv2cYx7686176AA= 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=o0JL1Hp0; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 10/9/23 13:28, Ranbir Singh wrote: > The function GetNextHidItem has a switch-case block in which the case 1: > falls through to case 2: and then case 2: falls through to case 3:. >=20 > There is no possibility of the if blocks within case 2: and case 3: to > succeed later and not succeed in the original case and hence the fall > throughs even if it hypothetically happens are redundant as the code > still will eventually return NULL only at the function end point. >=20 > Better introduce straight forward break; statement within actual cases. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4222 >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c b/MdeModulePkg/B= us/Usb/UsbMouseDxe/MouseHid.c > index acc19acd98e0..f07e48774a34 100644 > --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > @@ -89,6 +89,8 @@ GetNextHidItem ( > return StartPos; > } > =20 > + break; > + > case 2: > // > // 2-byte data > @@ -99,6 +101,8 @@ GetNextHidItem ( > return StartPos; > } > =20 > + break; > + > case 3: > // > // 4-byte data, adjust size > @@ -109,6 +113,8 @@ GetNextHidItem ( > StartPos +=3D 4; > return StartPos; > } > + > + break; > } > } > =20 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 (#109459): https://edk2.groups.io/g/devel/message/109459 Mute This Topic: https://groups.io/mt/101849998/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-