public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: Kun Qin <kun.q@outlook.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: Re: [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning
Date: Wed, 6 Jan 2021 03:33:56 +0000	[thread overview]
Message-ID: <CO1PR11MB5188AAE5A66736B80C916F7F8CD00@CO1PR11MB5188.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR06MB3102DD127EF77696D54A2877F3D10@MWHPR06MB3102.namprd06.prod.outlook.com>

Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Kun Qin <kun.q@outlook.com>
> Sent: Wednesday, January 6, 2021 2:59 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; Sami Mujawar
> <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth
> Venkatesh <supreeth.venkatesh@arm.com>
> Subject: [PATCH v2 03/16] StandaloneMmPkg:
> StandaloneMmCoreMemoryAllocationLib: Fix compiler warning
> 
> Assigning MmramRangeCount from MmCorePrivate (UINT64) to local
> variable
> MmramRangeCount (UINT32) will cause compilation failure due to "warning
> C4244: '=': 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 <ard.biesheuvel@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> 
> Signed-off-by: Kun Qin <kun.q@outlook.com>
> ---
> 
> Notes:
>     v2:
>     - Changed variable type to UINTN and cast before assignments [Jiewen]
> 
> 
> StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Stan
> daloneMmCoreMemoryAllocationLib.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 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;
> 
>    HobStart = GetHobList ();
> @@ -868,7 +868,7 @@ MemoryAllocationLibConstructor (
>        return EFI_UNSUPPORTED;
>      }
> 
> -    MmramRangeCount = MmramRangesHobData-
> >NumberOfMmReservedRegions;
> +    MmramRangeCount = (UINTN) MmramRangesHobData-
> >NumberOfMmReservedRegions;
>      if (MmramRanges == NULL) {
>        return EFI_UNSUPPORTED;
>      }
> @@ -877,7 +877,7 @@ MemoryAllocationLibConstructor (
>      DataInHob      = GET_GUID_HOB_DATA (GuidHob);
>      MmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob-
> >Address;
>      MmramRanges     = (EFI_MMRAM_DESCRIPTOR
> *)(UINTN)MmCorePrivate->MmramRanges;
> -    MmramRangeCount = MmCorePrivate->MmramRangeCount;
> +    MmramRangeCount = (UINTN) MmCorePrivate->MmramRangeCount;
>    }
> 
>    {
> --
> 2.30.0.windows.1


  reply	other threads:[~2021-01-06  3:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210105185935.3769-1-kun.q@outlook.com>
2021-01-05 18:59 ` [PATCH v2 01/16] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Kun Qin
2021-01-05 18:59 ` [PATCH v2 02/16] StandaloneMmPkg: StandaloneMmCoreHobLib: Extend support for x64 Mm Core Kun Qin
2021-01-05 18:59 ` [PATCH v2 03/16] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Kun Qin
2021-01-06  3:33   ` Yao, Jiewen [this message]
2021-01-05 18:59 ` [PATCH v2 04/16] StandaloneMmPkg: StandaloneMmMemLib: Extends support for X64 architecture Kun Qin
2021-01-06  3:38   ` Yao, Jiewen
2021-01-06  6:37     ` [edk2-devel] " Kun Qin
2021-01-05 18:59 ` [PATCH v2 05/16] MdeModulePkg: SmmLockBoxSmmLib: Support StandaloneMm for SmmLockBoxLib Kun Qin
2021-01-05 18:59 ` [PATCH v2 06/16] MdeModulePkg: SmmReportStatusCodeLib: ReportStatusCodeLib in StandaloneMm Kun Qin
2021-01-06  3:24   ` [edk2-devel] " Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 07/16] MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver " Kun Qin
2021-01-06  3:24   ` Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 08/16] MdeModulePkg: FirmwarePerformanceDataTable: Added StandaloneMm support Kun Qin
2021-01-06  3:24   ` Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 09/16] MdeModulePkg: ReportStatusCodeRouter: Support StandaloneMm RSC Router Kun Qin
2021-01-06  3:24   ` Wu, Hao A
2021-01-05 18:59 ` [PATCH v2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under StandaloneMm Kun Qin
2021-01-05 18:59 ` [PATCH v2 11/16] PcAtChipsetPkg: AcpiTimerLib: Added StandaloneMm instance of AcpiTimerLib Kun Qin
2021-01-13  6:50   ` [edk2-devel] " Ni, Ray
2021-01-13 18:38     ` Kun Qin
2021-01-05 18:59 ` [PATCH v2 12/16] SecurityPkg: Tcg2PhysicalPresenceLib: Introduce StandaloneMm instance Kun Qin
2021-01-05 18:59 ` [PATCH v2 13/16] SecurityPkg: Tcg2PpVendorLibNull: Added support for MM_STANDALONE type Kun Qin
2021-01-05 18:59 ` [PATCH v2 14/16] SecurityPkg: Tpm2DeviceLibDTpm: Introduce StandaloneMm instance Kun Qin
2021-01-05 18:59 ` [PATCH v2 15/16] UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm Kun Qin
2021-01-06 15:46   ` Laszlo Ersek
2021-01-06 15:51     ` Laszlo Ersek
2021-01-06 19:02       ` [edk2-devel] " Kun Qin
2021-01-06 19:07         ` Laszlo Ersek
2021-01-07 19:05     ` Leif Lindholm
2021-01-05 18:59 ` [PATCH v2 16/16] UefiCpuPkg: SmmCpuExceptionHandlerLib: Added StandaloneMm module support Kun Qin
2021-01-06 15:48   ` Laszlo Ersek
     [not found] ` <16576B257D31F1E6.24224@groups.io>
2021-01-12  3:24   ` [edk2-devel] [PATCH v2 11/16] PcAtChipsetPkg: AcpiTimerLib: Added StandaloneMm instance of AcpiTimerLib Kun Qin
     [not found] ` <16576B256B69BE5C.24224@groups.io>
2021-01-12  3:26   ` [edk2-devel] [PATCH v2 10/16] MdePkg: UefiDevicePathLib: Support UefiDevicePathLib under StandaloneMm Kun Qin
2021-01-13  1:14     ` 回复: " gaoliming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB5188AAE5A66736B80C916F7F8CD00@CO1PR11MB5188.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox