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 04DC8D802E7 for ; Wed, 4 Oct 2023 18:47:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=APtZkKjW9Wn7eg7n9zJhiPGPTDB8C+7NwLToPmyW//0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version: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=1696445234; v=1; b=Dy0T0c3ezZ693DBLZ1RKJqCZnBZn7nCk+2DxAv4cM305A0bWGL31zYO2ZKm0rSpf23CbyqCf 4sgDd+bZugP+8PuwkuLSU4Q04/5BtxpL5b9NCFJD+KPeP2sm4PHY8TO6osMOMKGqXVsve4TnyP2 6v39PpR2sVkjW24gzG7g+VKs= X-Received: by 127.0.0.2 with SMTP id iyYuYY7687511xtt727K9SBS; Wed, 04 Oct 2023 11:47:14 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web11.1781.1696445234022697185 for ; Wed, 04 Oct 2023 11:47:14 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="4833360" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="4833360" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 11:47:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="817235023" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="817235023" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Oct 2023 11:47:12 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 4 Oct 2023 11:47:12 -0700 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 4 Oct 2023 11:47:12 -0700 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Wed, 4 Oct 2023 11:47:12 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 4 Oct 2023 11:47:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhthqllBaPSWRko5HylAu7doSL0pfjYuFi6ivVgXBj2tKsBgv1POsvjYpFUfoYuqeDd/yrt3FU4epye70X4v/j+ICILFWXfPIL0uZ0MBIkfhU/g8AuhxJIuatDpAPDHneP6hcaxOjonG0Klm1vFK73rlrvCcuJdSHLbzIU4JjipvNBXqe+Zjp8o/9iYAkUZAa1iY8rqC0pD+iqLU0hRs4zWqCMos4N283NK4ZzzdHG3EyGB3v/bX8/rl+jRcKY3l1mLIFJctQkg46DwOvCMu3ZlKw0O/WmuMLizzrtf2P+H+rgg0Ii2DhrwNOhSF5p49lQhV7gADpA2/efvVmQPsrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Uio/xkMh6TPCnHAcGtq1Q8PSYxG5fDqO7jYQhLXXjMU=; b=L4Je7dO4u6phPWdqfQjDlq08hxEe9Up712BmG0tYG9XBOfNu4aR0blfgXT+9BymPywufguVsFzOw7wIuMVbet9ZiX6hb2mQQtEq+Ac2sT7NtuLdAFMT+F+IdtpJMn/PHUKhLp9mcV9nKmh8jf9J9E+AXAqAzZbxhfljCIBC/L+UMG8jPls4kWXAnvO7cCO4AS6qUtGUiG7Pe/xDTppuWnK2QxWdRXC3JpjRJbOI/s4+mNdYRPwT53K8JWIr0fbqGLX9Mfe1y/R3pTakwiB2kZU3HOcKejt2ewflhn9Q8Ru09tdPNBl0ZHGbGksjjboPenpDHniZc5CLTEiHbOL3whQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by CH0PR11MB5563.namprd11.prod.outlook.com (2603:10b6:610:d6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 18:46:58 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::2ebf:3b09:b169:ee2c]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::2ebf:3b09:b169:ee2c%4]) with mapi id 15.20.6838.033; Wed, 4 Oct 2023 18:46:58 +0000 From: "Michael D Kinney" To: "devel@edk2.groups.io" , "rsingh@ventanamicro.com" CC: "Wu, Hao A" , "Ni, Ray" , "Veeresh Sangolli" , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v1 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues Thread-Topic: [edk2-devel] [PATCH v1 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues Thread-Index: AQHZ9tHhGIb1Lt473UKrZngMIgTzBbA5+GDQ Date: Wed, 4 Oct 2023 18:46:58 +0000 Message-ID: References: <20231004054818.100353-1-rsingh@ventanamicro.com> <20231004054818.100353-3-rsingh@ventanamicro.com> In-Reply-To: <20231004054818.100353-3-rsingh@ventanamicro.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|CH0PR11MB5563:EE_ x-ms-office365-filtering-correlation-id: 73345364-8c33-4d08-cb39-08dbc50a49f9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: v/frKUeSNrW9kXMysWyGu8M/r8HyqOkJa5IRlsPsT4du3TJdtnUdWQbeAgJclPiXliWMBOLVTH6JBkUJsOTwlfmwJA6CbYLhKpAWA1cKhfphCx6mCLZ/EIgPQ+dQmbzDJrzP4IMotxfBtWoqP1ummCtlJNc5WxKozfw8hFhuj9cXrCnMojJj9JhbmNJZ2O3xPoYnpbIaQE/b62XDFxo5YWdTc1ata9AVLHEEVYrpnZLx5syXzgt6vwTDmLj27R+FOLslAs64ZwuSo7JzTs5sWepwV+T4UEAhG9ELyHpQsXiy6Km5Tejx7OEyfuEEHxufdnsQE1P4rChpehyvQYASBBx554FeNbzfsfcMGDYuZfiBHpQ4r83lPR7RjpnqcF+LHrxRbbt05pRElGIn3i+u4e8cUcqVkIucmCDWYKS2Y1TyuvddNjDEXYn1ZejmFLi3kfsiwIOaZzH2J06RE3hZi60+DVeK7H1wb+qaO+8Dizov0a8Fr7O+8itgCtPuPji32vuIiJqOytOaEURg3mlIZrg2Af3qi0Xc2zAFUxAZ1Kh1SLkgrn6aZTPf8nzWJX/TxTduHS4P5JGMoZ+GuwYPcvkMjdWTVkF2BnAsNGEfQ6W5HZNEsSOfi4kDz8xZ/RSxtiNG7DnH2u+XK3t64K3UZQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0SJuAMmPY7jhiyC92uM97N00vDPaJ7g0wJTntnuqhWUYy60jv81f5F6DMEI0?= =?us-ascii?Q?ETKjkxWaCX6S+MjUv9a4EiEzvDqJ7hOssaHF+xAJm+IhreyluvXcVuP3xM28?= =?us-ascii?Q?2FA8iIf2lECAG3v1qt+iR+HVGI0dr2RVnp2cUB/yb7QmbTStFE+85KH9Mg8D?= =?us-ascii?Q?mt2UkUNx1iE9KozgzNURnQrRxd5lU27R0eEUnuy1ultSPng3TplndjO3rBaj?= =?us-ascii?Q?8mLw081Zh1LeyeyTwrBJZ/Dsd3KioifB2McCHfUXjgoHmYSdMQpN3zSIfeok?= =?us-ascii?Q?dpAVV/J6NBCofBDjAMKbGlQeiPVHZKq0l3LS1FLlVN1u0G5wKjJ/kDtY1YLs?= =?us-ascii?Q?iwQ+xyGkqad1rX45vq0i1wS/9yi/OiyYr8PtCvxubtVqYR0/eNU+RCfnPD3t?= =?us-ascii?Q?eVZkcUnRY56k8CQWHg1xskpGZVEOEH2ftbqCy+4MlRk/ap7+Ec1G+CfAPI33?= =?us-ascii?Q?IRZZy2bbRg9jCf70xvAPMXtTZEVajC/WBoUq2K1BV9YDak4KHsdXjoLoiKJE?= =?us-ascii?Q?p6EbYC5p0X9f8PjhMN1ESvQUGes7YHMXpqBaoa2Xg3kQATfieqNWAA22AUqx?= =?us-ascii?Q?GF20s0XhPvpfoZsjA924yaIihuP3DchOSP0dvEIeYNzUUNNRi6L6NhZra8sO?= =?us-ascii?Q?EO978tT7xEB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MyiGzPKRN2zXyhgtV?= =?us-ascii?Q?Ey0j5zEWDbXVTX52uRdg74aTp7DnrvbfkPnp8F2D0gje5HxyX4kyHmVDPc3E?= =?us-ascii?Q?lA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73345364-8c33-4d08-cb39-08dbc50a49f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2023 18:46:58.4433 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: I5Huyt+/7nO0Ep08bb25yxCR+uZ6f3JOUKiVWkXyTOuVXcaEQkZ7nB+aRdZvlQnWl6r1DXoA3zwJzIMEacD818AP9ly7dX7rw8bnD5HOf5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5563 X-OriginatorOrg: intel.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,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZrnCahrtEjuby9IePvp5dRKIx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" 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=Dy0T0c3e; 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=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") I do not prefer special comments for one static analyzer. Is there an alternative design/implementation of this code to make it more readable and not trigger any static analysis false positives? Mike > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ranbir > Singh > Sent: Tuesday, October 3, 2023 10:48 PM > To: devel@edk2.groups.io; rsingh@ventanamicro.com > Cc: Wu, Hao A ; Ni, Ray ; > Veeresh Sangolli > Subject: [edk2-devel] [PATCH v1 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: > Fix MISSING_BREAK Coverity issues >=20 > From: Ranbir Singh >=20 > The function GetNextHidItem has a switch-case code in which the > case 1: falls through to case 2: and then case 2: falls through > to case 3: in the block. >=20 > While this may be intentional, it is not evident to any general > code reader as well as any static analyzer tool. Just adding >=20 > // No break; here as this is an intentional fallthrough. >=20 > as comment in between makes a reader as well as Coverity happy. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4222 >=20 > Cc: Hao A Wu > Cc: Ray Ni > Co-authored-by: Veeresh Sangolli > Signed-off-by: Ranbir Singh > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > index acc19acd98e0..bc9a4824208b 100644 > --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c > @@ -89,6 +89,10 @@ GetNextHidItem ( > return StartPos; >=20 > } >=20 >=20 >=20 > + // >=20 > + // No break; here as this is an intentional fallthrough >=20 > + // >=20 > + >=20 > case 2: >=20 > // >=20 > // 2-byte data >=20 > @@ -99,6 +103,10 @@ GetNextHidItem ( > return StartPos; >=20 > } >=20 >=20 >=20 > + // >=20 > + // No break; here as this is an intentional fallthrough >=20 > + // >=20 > + >=20 > case 3: >=20 > // >=20 > // 4-byte data, adjust size >=20 > -- > 2.34.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#109309): > https://edk2.groups.io/g/devel/message/109309 > Mute This Topic: https://groups.io/mt/101750274/1643496 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [michael.d.kinney@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20 -=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 (#109333): https://edk2.groups.io/g/devel/message/109333 Mute This Topic: https://groups.io/mt/101750274/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-