[edk2] [patch] MdeModulePkg/DxeCore: Fix coding style issues

Dandan Bi posted 1 patch 7 years, 8 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Core/Dxe/Mem/Pool.c              | 19 +++++++++++++++++++
MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  6 ++++--
2 files changed, 23 insertions(+), 2 deletions(-)
[edk2] [patch] MdeModulePkg/DxeCore: Fix coding style issues
Posted by Dandan Bi 7 years, 8 months ago
Add comments for functions.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Core/Dxe/Mem/Pool.c              | 19 +++++++++++++++++++
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  6 ++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c
index ced6444..1e37356 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Pool.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c
@@ -289,10 +289,21 @@ CoreAllocatePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Used by the pool functions to allocate pages
+  to back pool allocation requests.
+
+  @param  PoolType               The type of memory for the new pool pages
+  @param  NoPages                No of pages to allocate
+  @param  Granularity            Bits to align.
+
+  @return The allocated memory, or NULL
+
+**/
 STATIC
 VOID *
 CoreAllocatePoolPagesI (
   IN EFI_MEMORY_TYPE    PoolType,
   IN UINTN              NoPages,
@@ -551,10 +562,18 @@ CoreFreePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Frees pool pages allocated via CoreAllocatePoolPagesI().
+
+  @param  PoolType               The type of memory for the pool pages
+  @param  Memory                 The base address to free
+  @param  NoPages                The number of pages to free
+
+**/
 STATIC
 VOID
 CoreFreePoolPagesI (
   IN EFI_MEMORY_TYPE        PoolType,
   IN EFI_PHYSICAL_ADDRESS   Memory,
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 45f360c..1c44148 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -655,10 +655,12 @@ UnprotectUefiImage (
 }
 
 /**
   Return the EFI memory permission attribute associated with memory
   type 'MemoryType' under the configured DXE memory protection policy.
+
+  @param MemoryType       Memory type.
 **/
 STATIC
 UINT64
 GetPermissionAttributeForMemoryType (
   IN EFI_MEMORY_TYPE    MemoryType
@@ -786,11 +788,11 @@ MergeMemoryMapForProtectionPolicy (
 }
 
 
 /**
   Remove exec permissions from all regions whose type is identified by
-  PcdDxeNxMemoryProtectionPolicy
+  PcdDxeNxMemoryProtectionPolicy.
 **/
 STATIC
 VOID
 InitializeDxeNxMemoryProtectionPolicy (
   VOID
@@ -1051,11 +1053,11 @@ CoreInitializeMemoryProtection (
   }
   return ;
 }
 
 /**
-  Returns whether we are currently executing in SMM mode
+  Returns whether we are currently executing in SMM mode.
 **/
 STATIC
 BOOLEAN
 IsInSmm (
   VOID
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] MdeModulePkg/DxeCore: Fix coding style issues
Posted by Zeng, Star 7 years, 8 months ago
Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: Bi, Dandan 
Sent: Friday, March 3, 2017 12:45 PM
To: edk2-devel@lists.01.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Zeng, Star <star.zeng@intel.com>
Subject: [patch] MdeModulePkg/DxeCore: Fix coding style issues

Add comments for functions.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Core/Dxe/Mem/Pool.c              | 19 +++++++++++++++++++
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  6 ++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c
index ced6444..1e37356 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Pool.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c
@@ -289,10 +289,21 @@ CoreAllocatePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Used by the pool functions to allocate pages
+  to back pool allocation requests.
+
+  @param  PoolType               The type of memory for the new pool pages
+  @param  NoPages                No of pages to allocate
+  @param  Granularity            Bits to align.
+
+  @return The allocated memory, or NULL
+
+**/
 STATIC
 VOID *
 CoreAllocatePoolPagesI (
   IN EFI_MEMORY_TYPE    PoolType,
   IN UINTN              NoPages,
@@ -551,10 +562,18 @@ CoreFreePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Frees pool pages allocated via CoreAllocatePoolPagesI().
+
+  @param  PoolType               The type of memory for the pool pages
+  @param  Memory                 The base address to free
+  @param  NoPages                The number of pages to free
+
+**/
 STATIC
 VOID
 CoreFreePoolPagesI (
   IN EFI_MEMORY_TYPE        PoolType,
   IN EFI_PHYSICAL_ADDRESS   Memory,
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 45f360c..1c44148 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -655,10 +655,12 @@ UnprotectUefiImage (  }
 
 /**
   Return the EFI memory permission attribute associated with memory
   type 'MemoryType' under the configured DXE memory protection policy.
+
+  @param MemoryType       Memory type.
 **/
 STATIC
 UINT64
 GetPermissionAttributeForMemoryType (
   IN EFI_MEMORY_TYPE    MemoryType
@@ -786,11 +788,11 @@ MergeMemoryMapForProtectionPolicy (  }
 
 
 /**
   Remove exec permissions from all regions whose type is identified by
-  PcdDxeNxMemoryProtectionPolicy
+  PcdDxeNxMemoryProtectionPolicy.
 **/
 STATIC
 VOID
 InitializeDxeNxMemoryProtectionPolicy (
   VOID
@@ -1051,11 +1053,11 @@ CoreInitializeMemoryProtection (
   }
   return ;
 }
 
 /**
-  Returns whether we are currently executing in SMM mode
+  Returns whether we are currently executing in SMM mode.
 **/
 STATIC
 BOOLEAN
 IsInSmm (
   VOID
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] MdeModulePkg/DxeCore: Fix coding style issues
Posted by Zeng, Star 7 years, 7 months ago
Patch has been pushed at 7babb4372e6a34cbbc54249b25056272a5a9924c.

-----Original Message-----
From: Zeng, Star 
Sent: Tuesday, March 7, 2017 10:10 AM
To: Bi, Dandan <dandan.bi@intel.com>; edk2-devel@lists.01.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Zeng, Star <star.zeng@intel.com>
Subject: RE: [patch] MdeModulePkg/DxeCore: Fix coding style issues

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

-----Original Message-----
From: Bi, Dandan 
Sent: Friday, March 3, 2017 12:45 PM
To: edk2-devel@lists.01.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Zeng, Star <star.zeng@intel.com>
Subject: [patch] MdeModulePkg/DxeCore: Fix coding style issues

Add comments for functions.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Core/Dxe/Mem/Pool.c              | 19 +++++++++++++++++++
 MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c |  6 ++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c
index ced6444..1e37356 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Pool.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c
@@ -289,10 +289,21 @@ CoreAllocatePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Used by the pool functions to allocate pages
+  to back pool allocation requests.
+
+  @param  PoolType               The type of memory for the new pool pages
+  @param  NoPages                No of pages to allocate
+  @param  Granularity            Bits to align.
+
+  @return The allocated memory, or NULL
+
+**/
 STATIC
 VOID *
 CoreAllocatePoolPagesI (
   IN EFI_MEMORY_TYPE    PoolType,
   IN UINTN              NoPages,
@@ -551,10 +562,18 @@ CoreFreePool (
     InstallMemoryAttributesTableOnMemoryAllocation (PoolType);
   }
   return Status;
 }
 
+/**
+  Internal function.  Frees pool pages allocated via CoreAllocatePoolPagesI().
+
+  @param  PoolType               The type of memory for the pool pages
+  @param  Memory                 The base address to free
+  @param  NoPages                The number of pages to free
+
+**/
 STATIC
 VOID
 CoreFreePoolPagesI (
   IN EFI_MEMORY_TYPE        PoolType,
   IN EFI_PHYSICAL_ADDRESS   Memory,
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 45f360c..1c44148 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -655,10 +655,12 @@ UnprotectUefiImage (  }
 
 /**
   Return the EFI memory permission attribute associated with memory
   type 'MemoryType' under the configured DXE memory protection policy.
+
+  @param MemoryType       Memory type.
 **/
 STATIC
 UINT64
 GetPermissionAttributeForMemoryType (
   IN EFI_MEMORY_TYPE    MemoryType
@@ -786,11 +788,11 @@ MergeMemoryMapForProtectionPolicy (  }
 
 
 /**
   Remove exec permissions from all regions whose type is identified by
-  PcdDxeNxMemoryProtectionPolicy
+  PcdDxeNxMemoryProtectionPolicy.
 **/
 STATIC
 VOID
 InitializeDxeNxMemoryProtectionPolicy (
   VOID
@@ -1051,11 +1053,11 @@ CoreInitializeMemoryProtection (
   }
   return ;
 }
 
 /**
-  Returns whether we are currently executing in SMM mode
+  Returns whether we are currently executing in SMM mode.
 **/
 STATIC
 BOOLEAN
 IsInSmm (
   VOID
--
1.9.5.msysgit.1

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