From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web08.1553.1609873192669577225 for ; Tue, 05 Jan 2021 10:59:56 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=EVpP2j49; spf=softfail (domain: outlook.com, ip: , mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WuOSe8Xg3yeGZkTdLr0tAAIxlu52YxpdCBEnf7pE9lPKkA1ZRaXFgUsKXbeICudgkl4raCRGuxOzUcyHMtEXXXD6Yo++44C+65NfBVGDOVeKSPhqKtsH7pmd8rvGmvabu38Nbd2ZeMAgeZdXbXgwIYui2jlf9fLwR0P/p8/Xt9T5fzQGrFhOUKoW6cu5fk52IdOxNbTTm+9YbmzoK7L0dvpG/OMUaowNxU8PyvuvCJSSRIsSaWepk2LBkWTcALlBaq83Co575JGc2huOFEXPE0CWpIBBmRR4pN81yz+E9drOWoake0b5wMEK63YMzDVi862qpZxE8wusGuw/vxMMvQ== 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=8Pl0Aa3d3rhXa6R8FHLp8OydMO5nknHM6a3TruwGMDI=; b=c9TjkrXqQiApc24FYy16NYVD2xoP6ncCGeBHVqo+DasoRbYGIOwOf9wpR1ajgV7aUUm0SlMLVMHsK7l62tt/B69vCzT0sgRXh1xpoCs20vqH+tNPOXi6/0zetZv0EgsUOpiQxB3uIZbrQQtbu9uCj3ciEA3O14zVdxYFe63Ezcsq7VlbpQp/Iw92Hb/BbvYf4Vyz+1HcxV9wNjkRsnLOFHrSAP9Mq/NkHYq/Otdogi85rMJPxhfKeTb0W2a+6RBzYZVCjQWjkpaQbS0FSu22E3WoQSwp1SPZrYgbNdd2s7LZg7pusP7Ltc8Esm4ZCWLKhSuwiPDEBQn9AnPkMlIMTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Pl0Aa3d3rhXa6R8FHLp8OydMO5nknHM6a3TruwGMDI=; b=EVpP2j49bpCK8AZ3+IwXW5EdgaKIIEQ2cEdLxZdO9CRY7BTxHXTLW+ULHaZhr8/Kj0/scT0Vnad0tYVbNMBI+nSUEltBhiWZCeQgletdbjj3HZkXBmebJEHmLQMeNxLbBFRVQ1PUgFc6SLJXUWsDVtS9BbtUdcpaYuMf/E/4pfl55EEGvrd46r9BWqWZoK0Zs1Tz0yboYnPIaVt9qb7o0jKlCOoMGyLNcYpEa2pAoeLOlXZ5aI7Xx2RJnNR+qlLXXMv/0wIYLm8Tdg/8fu1b+2IhQOBJlJJkOaOYTp7rum9SFycN4qfmGqJAoZjhyMszfoZIuUJEM5rcqvZNxkBFWw== Received: from CY1NAM02FT003.eop-nam02.prod.protection.outlook.com (10.152.74.55) by CY1NAM02HT104.eop-nam02.prod.protection.outlook.com (10.152.74.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.22; Tue, 5 Jan 2021 18:59:52 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e45::53) by CY1NAM02FT003.mail.protection.outlook.com (2a01:111:e400:7e45::151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.22 via Frontend Transport; Tue, 5 Jan 2021 18:59:52 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A9762E2E6427DBF526FC4A59F5605F7059DFF38BEF956C163A7425764F977B81;UpperCasedChecksum:E1CD6CDA74AC9F7BB717F32E9DEF3D52CC66110F72EF21BACFA140BE57895AF6;SizeAsReceived:7516;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6%5]) with mapi id 15.20.3721.024; Tue, 5 Jan 2021 18:59:52 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh Subject: [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Date: Tue, 5 Jan 2021 10:59:22 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210105185935.3769-1-kun.q@outlook.com> References: <20210105185935.3769-1-kun.q@outlook.com> X-TMN: [H4SIuvCG8Z5jwreUBoRWD4CHvhxZCRe2] X-ClientProxiedBy: MWHPR22CA0045.namprd22.prod.outlook.com (2603:10b6:300:69::31) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210105185935.3769-4-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MWHPR22CA0045.namprd22.prod.outlook.com (2603:10b6:300:69::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Tue, 5 Jan 2021 18:59:52 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 40500bb8-7335-4c4a-eb7b-08d8b1ac1585 X-MS-TrafficTypeDiagnostic: CY1NAM02HT104: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VRmOc0e9+6uBO5RpeQaT0l77EBRuO8TgWv/2pBC9ekmgE3V0mc0gbqvzafcURwWZP4mP5nl2cYT/FwiVrbbSj1yhDg6QJWAJuXG7N3H2F9Ot4AIegnNRX2a+FlpDV1nkX9TeEkwHVv9Y2wFkT7XUhD+j9kqOu+W1e1uXhFPw4z0qwmwVgb7IMwqw9ulIWumaiuRbKNkVxQpsWNTUXtwehSEvB5eEO+b88U1Eg2TqBPEdyXjiwKkYAxbkXOQjuBov X-MS-Exchange-AntiSpam-MessageData: nlM8WvV5pV0TL9P43OUf6e2b+tTdI9q5lD0wpnGgXP9RYXOy65axpGndsWjyAWLPY5BfYGlYpGEXezqYQf2Q5EADYetoiiXlRgCnDFG+0/aPTTbzVGcT/pYBNfP68zYu6fE4jDndkMA4ps2NdlrZZQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2021 18:59:52.5565 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: 40500bb8-7335-4c4a-eb7b-08d8b1ac1585 X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT003.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT104 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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. Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Jiewen Yao Cc: Supreeth Venkatesh Signed-off-by: Kun Qin --- Notes: v2: - Changed variable type to UINTN and cast before assignments [Jiewen] StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCo= reMemoryAllocationLib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/St= andaloneMmCoreMemoryAllocationLib.c b/StandaloneMmPkg/Library/StandaloneMmC= oreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c index eb3d772e18c5..c6feb25a3821 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Standalon= eMmCoreMemoryAllocationLib.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Standalon= eMmCoreMemoryAllocationLib.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->NumberOfMmReservedRegi= ons; 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->Mmra= mRanges; - MmramRangeCount =3D MmCorePrivate->MmramRangeCount; + MmramRangeCount =3D (UINTN) MmCorePrivate->MmramRangeCount; } =20 { --=20 2.30.0.windows.1