public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type
@ 2017-12-26  8:59 Liming Gao
  2017-12-26  9:00 ` Zeng, Star
  0 siblings, 1 reply; 3+ messages in thread
From: Liming Gao @ 2017-12-26  8:59 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 77905a0..2632211 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
   //
   AuthVarStorage->Format = NormalVarStorage->Format;
   AuthVarStorage->State  = NormalVarStorage->State;
-  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) AuthVarStorage);
+  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - (UINTN)AuthVarStorage);
   CopyGuid (&AuthVarStorage->Signature, &gEfiAuthenticatedVariableGuid);
   ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
 
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type
  2017-12-26  8:59 [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type Liming Gao
@ 2017-12-26  9:00 ` Zeng, Star
  2017-12-26  9:01   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Zeng, Star @ 2017-12-26  9:00 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org
  Cc: Wu, Hao A, Ard Biesheuvel, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>


Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Tuesday, December 26, 2017 4:59 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type

In V2, reduce unnecessary () in the expression.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 77905a0..2632211 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
   //
   AuthVarStorage->Format = NormalVarStorage->Format;
   AuthVarStorage->State  = NormalVarStorage->State;
-  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) AuthVarStorage);
+  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - (UINTN)AuthVarStorage);
   CopyGuid (&AuthVarStorage->Signature, &gEfiAuthenticatedVariableGuid);
   ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
 
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type
  2017-12-26  9:00 ` Zeng, Star
@ 2017-12-26  9:01   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2017-12-26  9:01 UTC (permalink / raw)
  To: Zeng, Star; +Cc: Gao, Liming, edk2-devel@lists.01.org, Wu, Hao A

On 26 December 2017 at 09:00, Zeng, Star <star.zeng@intel.com> wrote:
> Reviewed-by: Star Zeng <star.zeng@intel.com>
>
>
> Thanks,
> Star
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
> Sent: Tuesday, December 26, 2017 4:59 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>
> Subject: [edk2] [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type
>
> In V2, reduce unnecessary () in the expression.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 77905a0..2632211 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -4125,7 +4125,7 @@ ConvertNormalVarStorageToAuthVarStorage (
>    //
>    AuthVarStorage->Format = NormalVarStorage->Format;
>    AuthVarStorage->State  = NormalVarStorage->State;
> -  AuthVarStorage->Size = (UINT32) (UINTN) ((UINT8 *) AuthStartPtr - (UINT8 *) AuthVarStorage);
> +  AuthVarStorage->Size = (UINT32)((UINTN)AuthStartPtr - (UINTN)AuthVarStorage);
>    CopyGuid (&AuthVarStorage->Signature, &gEfiAuthenticatedVariableGuid);
>    ASSERT (AuthVarStorage->Size <= AuthVarStroageSize);
>
> --
> 2.8.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-26  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-26  8:59 [PATCH v2] MdeModulePkg Variable: Update Pointer Minus with UINTN type Liming Gao
2017-12-26  9:00 ` Zeng, Star
2017-12-26  9:01   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox