From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.3511.1686208680869200486 for ; Thu, 08 Jun 2023 00:18:01 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WsGLIgvA; spf=pass (domain: intel.com, ip: 192.55.52.136, 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=1686208680; x=1717744680; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sjebvtjg3HMZ+RsbnB31okhIbPxaXRXY8Cu2NWdIFns=; b=WsGLIgvAGAW8faRChwb7xjAZ60hXIi9IbhQF0uArw80Xdfn32tfu3UlY x6CQqeVlCjik95O7Ry/tbFoSGtR1BmFxDYdV+RQ47xy8U37A07Y8og1h7 jN9Y5MGhKN/Vr9pWufYc2zHq4DhEJribN00dX96dscMxOw3BEkgy1wtA/ fjw+TU4LExYk3eIZJ5etCIOaIL6lgLUkW0cFMijVogFnE2GurK9TYftK5 6df1R3fGH9v3lPqEwBAZAt7UNtQg9woJ654D2dCarvQUJcaN8C/DKyTVg jyqEtWTxEXxiO3j9P/vd6iMEK89UJ5pXaSn0isaOnQB4BSFtyLYam+qme A==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="336860437" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="336860437" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 00:18:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="774945528" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="774945528" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 08 Jun 2023 00:17:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 8 Jun 2023 00:17:47 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.23 via Frontend Transport; Thu, 8 Jun 2023 00:17:47 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) 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.23; Thu, 8 Jun 2023 00:17:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=buNPc4QyDRo1NAIs6hvN9ei2P7kbStTLPN41bw9SWboSwU7oUK42gtuAOnOLDeLGApgz8JoK/vGk8Axml24DHzBuREjIiuvFE3H279YLRBZzi1wDGWgpnDc+C3+FZBpV9yQGEcq7J3fqF7Q4nPzUTMSIzCROa08XLW1J/ijAdowL7gkzTlrNtRKTWQ8v1FYhs6xV0a3i1hIAhkbYS0R3XAhhUPrfw7CKJ+yBUhJ1G5MkA7xtsi1vHQwt7YEolDOH/CjUEeempEw0m2TamszJ6MZIaJUERglmNrL7R8Fpgt9iK0G5Z9Kjx6FImL+nPCzzV/BXJymakYlkmG6l4WyAUw== 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=xRatphIhgt615UMKNXstR+kekUFwleBLNINt3nnYP/w=; b=LI0QOTPFXJPD5/raDrvuRCGkR6wM6Uv6mlr7XCvs0v7uev2qQKCx5Co+FslU8cDnelEQISlLlW1EISYndYg5p4KnGpyiIej2f/O8+33PNB0Z+ZDO/255tKIXu+4dJYnkz4kVgKkTsPY2LybL9ifPPe65ysK7U2CDKt/5/3K4NZHOMiCzuPfqC32Wgk1x6qkYK8XJKaqao8ukG6aH/X/2wPpY0tB1tTjM20nT2HWKy9sD3eXkaS5cz3puyeULvu7RQfEHOXGmU5Srh4LtRc+F41/hhE2PZ6pylUMI/L3RHVuBsv8LD4O5gP9bjFIQxscX8h/Fw5DsrevJmGK6ute6Cw== 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 CY5PR11MB6343.namprd11.prod.outlook.com (2603:10b6:930:3c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Thu, 8 Jun 2023 07:17:45 +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.6455.030; Thu, 8 Jun 2023 07:17:45 +0000 From: "Wu, Hao A" To: Ranbir Singh , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue Thread-Topic: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue Thread-Index: AQHZlWylDE2PK4MUA0anoORNPsaXEa+Ah0LA Date: Thu, 8 Jun 2023 07:17:44 +0000 Message-ID: References: <20230602160852.98282-1-rsingh@ventanamicro.com> In-Reply-To: <20230602160852.98282-1-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_|CY5PR11MB6343:EE_ x-ms-office365-filtering-correlation-id: 551ca591-a9c1-4a9c-629a-08db67f074af x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xMgXow9q42w9mZ6pp+nOdc5v/YbujDjE+6KuKgXnC0p1pJ9d5L51BBxYttPJZHX+EFP1YHR9PJgSiMp8VcQ6Uub4cXMVCoQA8Aul29EmqIjnx9n94ERAUmT8esrFoo6K0ay2OOurC+FR2xsW6ZbqNLuO+kz4VdYX1McbLROWx5zEd0q8rg7HyPWjqRcFz39WpA6oWfQpp8Xzv4xz3Kun1gYRPsnMcGE11XxI8C4T62YD+587+1L0tgEu7pa/qJ77uPI1pV9QhBueggsOWOsI50Bh7Q/PFwcgjWcdZIGPyZtz03hhRZqYgdUb5hQXuRAbWadj+H5KCqcbkMaV6CTceOxeKT6OI63GPtcx50+IV32cmeeQWMnlZTz7XMgHsf7Evmysw+muBuhY1qYxgfS6QbrNJadRdwsNZIMDRXjUW22RQ+YKqgrlNQ/XFKa9zoLvOtbRgGopAVt281pDHCCGZIESXdgHhMY4uIhJVvG3c+YTRipnTeTnp/jJVJFQkUeBEntXr1LmQC2INCoQ5KY+Zoy/7HTKev/ZE1IOvKdtx0zzfJz6a5MJ9bZ3t13wtiXqe/Wsb/1iMc/PNSLXY3tklLIkKT89oGDR1FrvgrY4onYYOIEOZ8O+i141hGmD4HSeDLZCnuHVqkEKIDtkB4v4+Q== 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)(366004)(136003)(39860400002)(396003)(451199021)(41300700001)(316002)(110136005)(122000001)(82960400001)(52536014)(5660300002)(2906002)(66476007)(4326008)(64756008)(76116006)(66946007)(66556008)(8936002)(66446008)(8676002)(478600001)(71200400001)(7696005)(966005)(38070700005)(86362001)(186003)(38100700002)(55016003)(26005)(107886003)(53546011)(9686003)(33656002)(6506007)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lGKP1hluB6/7Ox+UUbOVo7hmpE1EKJlKkuwYC+3MXjHX1LroggrEqvkE34Zx?= =?us-ascii?Q?/9ILSyq3fN53zxQpBs2ZhuVaInjVB484HkqFl0JszTWlFowZfh3woq5dSuT9?= =?us-ascii?Q?31FOzGRH/kDTq/ggLp86T5YOiaUBplObo4RTe5l2rRkXDLjxF48nEQ+P/VLq?= =?us-ascii?Q?pXurbUCDVPkr9GUDFSqRVTvrctEIzhDXRK4ZlrxSau78ZY1UN6jS019iWJbT?= =?us-ascii?Q?pgHZ0HCLOJZ+iNPhIVPzdXmfZq7xxPwjujVimTtDuKDgwW3bbS1FamWmcNZM?= =?us-ascii?Q?n06I/aagMC9maUzDdUSWGLX9RcTAzhiCnwytRNNJvyo4aFx4ADHwJhVofoMz?= =?us-ascii?Q?gvno/oBVCqxX6LHDD1kM902r6wumwMhlA4b6qtobFID62pSAaweOkwlGVEXl?= =?us-ascii?Q?Y1Wwx9xKQmNt7S23gSdQhztfua0sptZ7OKhZS75JSIQH3ZoKcdm00q8Y7yGb?= =?us-ascii?Q?ec8Q2MPXAqSiuRdRDMGl/yA+TML+JypgRFfP3y6rYLACY/wPRntecEB3axgN?= =?us-ascii?Q?2lj5K56U/2sXGZ2kApruseL8FzzCO64VrZ2IhUlT3cGqisMnMxH/Eek5wAtY?= =?us-ascii?Q?oOgQAQIi1LPTLb2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ApG?= =?us-ascii?Q?E55932PabGSZ1d781tLg4fwMsXGjMeaP1RWTn8qQOoDJ53/6sw4CREe5E5z3?= =?us-ascii?Q?GtGfVHkySc9YKrdnlX1/SYPMNYAhFokMQ39/oj0Z?= 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: 551ca591-a9c1-4a9c-629a-08db67f074af X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2023 07:17:45.0042 (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: zh1mDr9mA5YcLaK4OIV6go2Xt+jvzmAM8jfHXPzr7778qsiIZW8SmE0oEeFbQ1Dq9CDJ4q+sxxqg7sXk1PD0mw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6343 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 > -----Original Message----- > From: Ranbir Singh > Sent: Saturday, June 3, 2023 12:09 AM > To: devel@edk2.groups.io; rsingh@ventanamicro.com > Cc: Wu, Hao A ; Ni, Ray > Subject: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix > SIGN_EXTENSION Coverity issue >=20 > From: Ranbir Singh >=20 > Line number 365 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=3D4209 > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > index a77852bae054..ccd4c5f05b59 100644 > --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > @@ -362,7 +362,7 @@ IdentifyAtaDevice ( > // Check logical block size >=20 > // >=20 > if ((PhyLogicSectorSupport & BIT12) !=3D 0) { >=20 > - BlockMedia->BlockSize =3D (UINT32)(((IdentifyData->logic_sector_si= ze_hi > << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); >=20 > + BlockMedia->BlockSize =3D (((UINT32)(IdentifyData->logic_sector_si= ze_hi > << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); >=20 > } This patch seems to have the same issue with the concern raised in https://= edk2.groups.io/g/devel/topic/99293622. Best Regards, Hao Wu >=20 >=20 >=20 > AtaDevice->BlockIo.Revision =3D EFI_BLOCK_IO_PROTOCOL_REVISION2; >=20 > -- > 2.34.1