It looks good.
Reviewed-by: Liming Gao <[email protected]>

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]] 
Sent: Monday, July 16, 2012 8:33 PM
To: [email protected]
Subject: [edk2] [PATCH v2] MdeModulePkg: reuse CalculateCheckSum8() in 
AcpiTableProtocol.c

The module already depends on BaseLib.

v1->v2:
- <Library/BaseLib.h> is already included by "AcpiTable.h"
- insert space between "CalculateCheckSum8" and opening parenthesis

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 .../Acpi/AcpiTableDxe/AcpiTableProtocol.c          |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c 
b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index 6505de8..64b3b21 100644
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -1571,10 +1571,8 @@ AcpiPlatformChecksum (
   IN UINTN      ChecksumOffset
   )
 {
-  UINT8 Sum;
   UINT8 *Ptr;
 
-  Sum = 0;
   //
   // Initialize pointer
   //
@@ -1586,16 +1584,9 @@ AcpiPlatformChecksum (
   Ptr[ChecksumOffset] = 0;
 
   //
-  // add all content of buffer
-  //
-  while ((Size--) != 0) {
-    Sum = (UINT8) (Sum + (*Ptr++));
-  }
-  //
   // set checksum
   //
-  Ptr                 = Buffer;
-  Ptr[ChecksumOffset] = (UINT8) (0xff - Sum + 1);
+  Ptr[ChecksumOffset] = CalculateCheckSum8 (Buffer, Size);
 
   return EFI_SUCCESS;
 }
-- 
1.7.1


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to