From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.364.1689136707798206683 for ; Tue, 11 Jul 2023 21:38:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=epT1zv2m; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689136707; x=1720672707; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sGfv9gvJbsuvEGv8dHdrRZeyjDUpha5QQuSqfPqBDm8=; b=epT1zv2mZc2UsXZcK+sCMtB3rWaPg0aKyuXKWDta0t/6frmX/iIJGqU1 o5MYumU3mpsvv6ScbruEgkVtY2+VzeoKF++dg3H47TfGLRR4IhHS7CqF7 mLbul+R6gpBzeMo4rFLRZt53Nr9VhxXsE/0igmG0WypBYDD/vWNmgViJg ueURNAOWvC2egy0YubYQPYLyPtPfVOGIfWJhs/jlTFQ6aeYWvI0qOb3pF G3X2gWjHdiiRycKZKdJlf7kbg8pvaEGVjRVa2kGHQ7urLgd6mAhotVsJt oalU5IIaDC8oFQc4eiPHD8fY6y1bj6wlFMmJZHMtuGO4Y7B2s0iFLXXBb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="364834686" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="364834686" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 21:38:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="671682463" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="671682463" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 11 Jul 2023 21:38:21 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 11 Jul 2023 21:38:20 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 11 Jul 2023 21:38:20 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 11 Jul 2023 21:38:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cGyh2agu1TLQOYznM9YeD7U6OBrWAJTh++eFasfDVe08fHNOnMlJoz4C8SLqVe5t+UaAc+Z6xUnVbmLxjwjtFqcSzDA7xohwqjjpU0b6EMA4yWxeR40V/lpkvcEZtoaFfO87t10pkii85ZN6rd9/KkRYhmu73EP7OnqtKLtrIwCzkvaScQhkkXwGyzXbiGIxAwO4YsG6HZYJL/yOgWv+AG4ivaJufaOZKPwFb2h6gv5zDRDdYi5y+lhLaou9UMMUDBd0kiPb59DydVL54M3l0QASjps6cx20U8HkSCh1hTOH0mxB9GgwNMG/DYG1fAHk1Jt5kUZyDeR+QjVJ55yGVA== 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=QQVyDtoRlDUAqd4Po0M2rSxMI8cCb0ikLQdap8J7fLU=; b=Ak1VUN/M6jKAfAEix+x1VAxKKWyvISlEsYRYC+uYjnEOuxh0ElzY442PY0CZL4vKzdhK36KGv8F4dfF7I7lht4N+4qsA3VzhD9vuFifuJpGFphBSYEFR97it9hf8Lq+yHSJ7wixKmbziK72nR5GryAzKZxtDmIQ35QAmBmko5TZyeMaBPcfq42L1fg9A68SdwRVTnSe7wGvSbuRb26lQ3o8/0T/EgEjdSkgz48KyIOn5RDhfUyXPn5pyWQsw99dNiAHL8533G2IGiWgxuOxVte0cLZnsCrXCXKqNtRgtXruXWbua8qPr+Nw5vexp6wmXiXojs7JLj50HDRSJRiHppg== 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 Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DS0PR11MB7558.namprd11.prod.outlook.com (2603:10b6:8:148::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Wed, 12 Jul 2023 04:38:18 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::9c7e:53ba:995f:bc30]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::9c7e:53ba:995f:bc30%4]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023 04:38:18 +0000 From: "Wu, Hao A" To: Ranbir Singh , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH v2 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Thread-Topic: [PATCH v2 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Thread-Index: AQHZms6iW2N8uWdrnESkJS3o7B9kzK+1qU0g Date: Wed, 12 Jul 2023 04:38:18 +0000 Message-ID: References: <20230609123322.191390-1-rsingh@ventanamicro.com> <20230609123322.191390-2-rsingh@ventanamicro.com> In-Reply-To: <20230609123322.191390-2-rsingh@ventanamicro.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|DS0PR11MB7558:EE_ x-ms-office365-filtering-correlation-id: 923ebf87-e021-495d-7e71-08db8291d0a6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +z7XIoSFQ8dtEgtc93/M4Ivt/Iu/uymFh97TKjEa2t6MtN3kVyAc54F9ruM+pmH5XN3sIV0LGcijVTZsDEYLmiqRFk/6JFfK0ytGxN0BjakatmckbhvjZC+1biwNR/knEtt/o2fCiPNvdIjEbY8vjGlZbWq0jESr7lBfIUOoWXa+C0QK8EW9Wk/w38rBzqmijU6bD6WECRgj8emB1V3HVc8+TRjc6BOkmB/OG+lPkAnL2LoYQFTdCBcGNRqkIStTApYFSgdF/zn9aeAPsnt5sKaZQccTVAwoowD4H81O/ITaUdhxKAgmJgHcLvlA3EpWOMgq9EO/V5fBtwAu2Ko4TBbKfR9N7J5SwSV1fJdg4K2HJp4hzxxIpLw4TfBIZ2/XbBJWMwApV+gtq4PRcna6cFKjkoBrUn2NzgKcTWeBQNNo/COE3D+WvMcxH+bQw8+K2SM43idLi+FE5GCRvSkhk6+ir9iJmGVnbLwTVsKhSqUNHqdPPam8E3GRLi6cWeT7MeZv85qKSlfr1L7gaAfyGbswNwO3fplGiq69ypXgkVfVvDvVdnIGDLC7B6gu+TjIbGn1sSQRTqvoTrRfwSUXyQXO6zcB8PE68zS0ErVRlLE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(396003)(39860400002)(366004)(451199021)(33656002)(5660300002)(2906002)(110136005)(71200400001)(7696005)(478600001)(76116006)(41300700001)(66556008)(66946007)(8936002)(316002)(66446008)(64756008)(4326008)(66476007)(9686003)(83380400001)(55016003)(82960400001)(966005)(38100700002)(122000001)(52536014)(86362001)(6506007)(8676002)(107886003)(38070700005)(186003)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ixxkUcMUMJ7Y9tGBtLcIGR8/NwOU3kTnT5fTXLNJjR3wp454ggnmaCu0fOWs?= =?us-ascii?Q?f42Zvc/4If0X+UKEC/v+4d6qLYD+2T08eCQupa3UREY6pFJifS5A1dCrX0dB?= =?us-ascii?Q?6IkjD7gC0kD8j4Ebc8CEUcp0vHtdJMncHeUUrod5dRzT44SDL37bS5xKm8+B?= =?us-ascii?Q?MIvXm1dHKf8PdQf+Sydd3SqGJDRf6y1ZWuae9GRSIiTwL1InWwoQk24C2WUU?= =?us-ascii?Q?J9gl3jE68VONlwI2wfG2i979wJXGFB3lXCO1F24/e/83j/zD91Qn1uYpQ4DI?= =?us-ascii?Q?2UwQ+RWdsY1A6YfHlCNWZcV0+fGGfqhiyopY3oHLp0TFhS9zoMwwJ2o7pCIO?= =?us-ascii?Q?qGY1XWHtMpC92Jr5BMUkQsLmbjYVqhZKpfo+ppiMgv9tOG4MjMIkMl3KfN27?= =?us-ascii?Q?j/Ic67DzJCpwhBFdfc2G5odmB1xRcEHt0v6mtE/+HpoHnQ95uoMstHCxf5Vw?= =?us-ascii?Q?biqpdbY7swL8xHQKkzRAY508uehZoAe8/6n2H45e1QjYHxv8jspsJGVYP2uJ?= =?us-ascii?Q?Emv327ZAi4GjYCF97xbypwCmyHNXNhA4OzeyqAMGyujLj1FcFBsxoHCQ/SUj?= =?us-ascii?Q?s39KBs9OvVUJQ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I+4e?= =?us-ascii?Q?0JEcx3YnLqMpwxyq8S1j1V1sB9uFKs7U3w4Y10PC9dlums+Z8AFTqARrPA?= =?us-ascii?Q?=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 923ebf87-e021-495d-7e71-08db8291d0a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2023 04:38:18.5020 (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: Xskz7yaDTlNdFaBzkAxlCJZHdOdDfVNuWy/QErRyTwnde4e4mIqi7ul684Kg/j2A76cTjawLxf8da+Jt7Fegcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7558 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: Ranbir Singh > Sent: Friday, June 9, 2023 8:33 PM > To: devel@edk2.groups.io; rsingh@ventanamicro.com > Cc: Wu, Hao A ; Ni, Ray > Subject: [PATCH v2 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix > SIGN_EXTENSION Coverity issue >=20 > From: Ranbir Singh >=20 > Line number 1348 does contain a typecast with UINT32, but it is after > all the operations (16-bit left shift followed by OR'ing) are over. > To avoid any SIGN_EXTENSION, typecast the intermediate result after > 16-bit left shift operation immediately with UINT32. >=20 > Cc: Hao A Wu > Cc: Ray Ni > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 > Signed-off-by: Ranbir Singh > Signed-off-by: Ranbir Singh > --- >=20 > Notes: > Retain outer cast >=20 > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > index 50406fe0270d..f39c909d0631 100644 > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c > @@ -1345,7 +1345,7 @@ AtaPassThruPassThru ( > // Check logical block size >=20 > // >=20 > if ((IdentifyData->AtaData.phy_logic_sector_support & BIT12) !=3D 0)= { >=20 > - BlockSize =3D (UINT32)(((IdentifyData->AtaData.logic_sector_size_h= i << 16) > | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16)); >=20 > + BlockSize =3D (UINT32)(((UINT32)(IdentifyData- > >AtaData.logic_sector_size_hi << 16) | IdentifyData- > >AtaData.logic_sector_size_lo) * sizeof (UINT16)); >=20 > } >=20 > } >=20 >=20 >=20 > -- > 2.34.1