From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.3191.1609904040553143898 for ; Tue, 05 Jan 2021 19:34:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=HXf5jyhT; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: jiewen.yao@intel.com) IronPort-SDR: PbnKcr++n9TDF2H9HCL097wKQOWYdn5WG0YcER7ukB8Z+fIioRNABYlC7YsqpjFNIqb7gPP9Oh 8L8HCpuEiivQ== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="241301096" X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="241301096" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 19:33:59 -0800 IronPort-SDR: VjNVifwrdZKjKvKoOJRfYpwkVGZ1cPLmtlnM8Spam/5dxBhyF5+3tO+6PWWQq85ca4wf9oIbKb gnkHDu+4TU7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,478,1599548400"; d="scan'208";a="462540413" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 05 Jan 2021 19:33:59 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 19:33:59 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 19:33:58 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 5 Jan 2021 19:33:58 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 5 Jan 2021 19:33:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O3ePvrh8Eojl+jQ0+SUnlp9wPbwGQb82mFmRIGO/I8u+1REIB7GQpwoT4JvPka8GNfdm7wJvRRhbArdIx88lCz91QFhfLCzW2ZGl/hEtaWonnySXIl7l3Hq6Y4f4dfj11i555MW853bmsK+zDQkrpwL2cl0BcHkVHBg0Jqy5820BMPSThnSUsOfBEiosOoiAYU/YYMSgsEB2tIUMihySSQZFQYL4T0N+uxI/HgmmD+DH49V/Km8AEXrwtM5QPQ4iRSEfacGkyj9a6R4aLdzJwKC4emrVdwTeQZkwtRJrlEVaJcFgOWdBU8kz0BkbMVbqSwthhUBQK1QligrpxEfgTA== 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-SenderADCheck; bh=RIDiu3c9Yb8ljUzIne5LoDXrxxMQN+wWpSXjnLsUCHA=; b=LABAqfMh3KdN8bcriLTxaW3WHvJaxVEAbOufQRzkoGuMbPAIymZ6AejwRlsigYBTyzxkbQ2H13R+HUCt0bJotHN4rbo23kv+phKFnD7xFgO7NiGp3CLrawLe/pqwkDk01q70IkXvGtmSnQpFsqi74254FcQMrEpTzCsRP6raI8U+916joHWnm1wiZ+t6NjYHYMXah+6upnO1b9kV02PMfBiZZ1xXRlqBBQqF0jQGTeh8HlpjmnMwyUerzOrg0glH1jDtzx0RTUpqVkPAyG23ZZxaraO++LMJxBPbcmCpw2FmFJi0f6tnOI9kCJC8ffKG2hUe7dJYt5xi8JzV2P6Kbg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RIDiu3c9Yb8ljUzIne5LoDXrxxMQN+wWpSXjnLsUCHA=; b=HXf5jyhTMaluvKn4zRemQDQwXqDy20pwaD2BO0WabAWSdVQE6ORRdyC+NuaTpxNymJWqVOQvIpfkRj/qnYT1I1czvqoGDc1TOxio4HDnNbtCBvBDAKJGRsb00Cc61OeSPWm1KEv3nRUU9qCCFfDPEgw3Vj/S6gqCb6TXOHF5orI= Received: from CO1PR11MB5188.namprd11.prod.outlook.com (2603:10b6:303:95::16) by MW3PR11MB4729.namprd11.prod.outlook.com (2603:10b6:303:5d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.21; Wed, 6 Jan 2021 03:33:56 +0000 Received: from CO1PR11MB5188.namprd11.prod.outlook.com ([fe80::14d2:6c29:dc6d:5d6a]) by CO1PR11MB5188.namprd11.prod.outlook.com ([fe80::14d2:6c29:dc6d:5d6a%3]) with mapi id 15.20.3742.006; Wed, 6 Jan 2021 03:33:56 +0000 From: "Yao, Jiewen" To: Kun Qin , "devel@edk2.groups.io" CC: Ard Biesheuvel , Sami Mujawar , Supreeth Venkatesh Subject: Re: [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Thread-Topic: [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Thread-Index: AQHW45UGs7DE2kmhzEmQglzku4uoraoZ8kzw Date: Wed, 6 Jan 2021 03:33:56 +0000 Message-ID: References: <20210105185935.3769-1-kun.q@outlook.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: outlook.com; dkim=none (message not signed) header.d=none;outlook.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.204] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 57dc2cee-3c1b-4384-fcbe-08d8b1f3e5c7 x-ms-traffictypediagnostic: MW3PR11MB4729: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:186; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: H+8JZDBpLJypQTvly6qhfqYNuCfrDX1lHMraIJiVmKugt64k95ilV7NmYFteTPbGKYc4TxFCADuULl+GUillodHCyQNF6Uju1lKhPJ3oeOvDx174JRHFRghQNuPjoWfO83tDydIjDWcT57A2FSFL7Q0TAjA+A2Q1Ne50lXpdfNl6IvIOcPauYhtXdpQlxL+QdduEhyTnbF7XsN5NoFBvH+pUf/4itmNNWe4OQ4PXxXHxSIJAIjuHoikkFHkvSX6r+SR5ArH7+vEvKpK5w9FvZwgC+oOhjECM6u5aFRjjRdXujtENLIOjuTWdwvkCm3oWV9ZIJOflbGNg/ljyMhKJEgZ29ZTJ8gKMVmBBhEJWhRmT+SZPEwQmGMrwy+LQ5yCho65h7M8hy02D77o0Cup2WQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB5188.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(346002)(39860400002)(366004)(376002)(136003)(396003)(66946007)(66446008)(66476007)(66556008)(8676002)(64756008)(2906002)(8936002)(76116006)(52536014)(4326008)(86362001)(7696005)(54906003)(110136005)(53546011)(9686003)(26005)(83380400001)(71200400001)(6506007)(316002)(33656002)(5660300002)(478600001)(55016002)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?dA3R8+rZ6LnzWNzlQx4am8SuRv9QTuRHT8wYpAnJJqslz3MoKLvi78Ixt7SM?= =?us-ascii?Q?ZsdbCwg05+Vkzz4PLJwDQwIrea3++qSpk64SFVHtkAzEsKzXnkrdti9I1TgN?= =?us-ascii?Q?q9rL0nCxL4IVXQ601Wyefy1IwY5/2BY/TvQFFJWHPYzFjchRzQfgUD9Kp0fN?= =?us-ascii?Q?ci8nNwSVzbB2R+J34e45g440Yo7AmhmNOWtQKN77MVYEi44K2LpbjwDdhjRd?= =?us-ascii?Q?O0vAo7hh+yVyQLeO07fKn+wuAsrJtYajhvg+GmCRWSKSEzJv7r1Q0Lz6n3rJ?= =?us-ascii?Q?tPAt8eakMRwZU8RkOn0E1LwLzq+vaaErr5BWmuTvJ76UI2Zu+fOsDAGXuCns?= =?us-ascii?Q?Cv+DoZTn10YX5JK+4IJpeO27HD5yGclsjIJwS50eOg7CzF6NIZ6O1DQajlor?= =?us-ascii?Q?e1JkTZgUqnVWG8j0J5YznNOnANAq3ZAnlCgHqdP7cmMidF+YXP68b7nWJUde?= =?us-ascii?Q?zPGNWF3IAn1RTWv203SfU/Jn5tlidIF0bfupdB+2AplPPIGdFAx8uceu1cuI?= =?us-ascii?Q?DUGv9YOfxn7RE3xQ53OiStW8jv6DxVim1BBALvUT7O7nMeK/vbE1Q/XzhG/M?= =?us-ascii?Q?eGP5HQae/KUpcGjpld4vyhJ3EmJ010YID52bqKK3IT6LaPWgrYE1ktat0A5v?= =?us-ascii?Q?ibwaH+fkfmoIuIENe97S0dZVEVsl3OG6FmtK5eE1j+rYVw43GIn/Vh9ni/05?= =?us-ascii?Q?NNZ3S5thaIfOoSHMu2vQaPZxjhCU8VT+qXSDWuSi4cJ8/o+jC5/NjNsYdpUs?= =?us-ascii?Q?le8MnuukBsQDFJA4qt5rJ6+bQSbJ4DL/6gLFsVUZ8GMWyoGIYnPVTYf1O1no?= =?us-ascii?Q?TThFht3qI9zoRH75/5C3MxUouaJC/Gu/Nxj7w6Wei1AK0cMI+zkfQIiDbAMn?= =?us-ascii?Q?tFVtLzparNLgcgIWwQvvC7f7pbjNtJ9U0LYmSZarGm6d15P/tdGlvNVd9w4x?= =?us-ascii?Q?bnAB/j+Lv4+YxuyjosmLR/ghBXapyLGKFnOVHBlsLwQ=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5188.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57dc2cee-3c1b-4384-fcbe-08d8b1f3e5c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2021 03:33:56.1211 (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: vChFP7iJy5HOnMkGwPfAHB1S5+j30gOUpDd6UL+965MHV4cE5QrVbGckr9u+4cWZwI55zV/AChjTFy3j+qHkLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4729 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen Yao > -----Original Message----- > From: Kun Qin > Sent: Wednesday, January 6, 2021 2:59 AM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Sami Mujawar > ; Yao, Jiewen ; Supreeth > Venkatesh > Subject: [PATCH v2 03/16] StandaloneMmPkg: > StandaloneMmCoreMemoryAllocationLib: Fix compiler warning >=20 > Assigning MmramRangeCount from MmCorePrivate (UINT64) to local > variable > MmramRangeCount (UINT32) will cause compilation failure due to "warning > C4244: '=3D': conversion from 'UINT64' to 'UINT32', possible loss of data= ". > This changes defines local MmramRangeCount as UINTN type and adds type > cast before value assignment. >=20 > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Supreeth Venkatesh >=20 > Signed-off-by: Kun Qin > --- >=20 > Notes: > v2: > - Changed variable type to UINTN and cast before assignments [Jiewen] >=20 >=20 > StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Stan > daloneMmCoreMemoryAllocationLib.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git > a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > index eb3d772e18c5..c6feb25a3821 100644 > --- > a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > +++ > b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > @@ -841,7 +841,7 @@ MemoryAllocationLibConstructor ( > VOID *HobStart; > EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData; > EFI_MMRAM_DESCRIPTOR *MmramRanges; > - UINT32 MmramRangeCount; > + UINTN MmramRangeCount; > EFI_HOB_GUID_TYPE *MmramRangesHob; >=20 > HobStart =3D GetHobList (); > @@ -868,7 +868,7 @@ MemoryAllocationLibConstructor ( > return EFI_UNSUPPORTED; > } >=20 > - MmramRangeCount =3D MmramRangesHobData- > >NumberOfMmReservedRegions; > + MmramRangeCount =3D (UINTN) MmramRangesHobData- > >NumberOfMmReservedRegions; > if (MmramRanges =3D=3D NULL) { > return EFI_UNSUPPORTED; > } > @@ -877,7 +877,7 @@ MemoryAllocationLibConstructor ( > DataInHob =3D GET_GUID_HOB_DATA (GuidHob); > MmCorePrivate =3D (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob- > >Address; > MmramRanges =3D (EFI_MMRAM_DESCRIPTOR > *)(UINTN)MmCorePrivate->MmramRanges; > - MmramRangeCount =3D MmCorePrivate->MmramRangeCount; > + MmramRangeCount =3D (UINTN) MmCorePrivate->MmramRangeCount; > } >=20 > { > -- > 2.30.0.windows.1