public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] SecuritPkg: Tcg2: Fix coding style issue
@ 2017-01-05  2:18 Zhang, Chao B
  2017-01-05  2:44 ` Bi, Dandan
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang, Chao B @ 2017-01-05  2:18 UTC (permalink / raw)
  To: edk2-devel; +Cc: dandan.bi, Chao Zhang

Fix coding style issue

Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
---
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 14 +++++++-------
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c           | 16 ++++++++--------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
index 3e34155..1317dca 100644
--- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
+++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
@@ -381,7 +381,7 @@ Tcg2RouteConfig (
 /**
   Get HID string of TPM2 ACPI device object
 
-  @param[in]  HID               Points to HID String Buffer.
+  @param[in]  Hid               Points to HID String Buffer.
   @param[in]  Size              HID String size in bytes. Must >= TPM_HID_ACPI_SIZE
 
   @return                       HID String get status.
@@ -389,7 +389,7 @@ Tcg2RouteConfig (
 **/
 EFI_STATUS
 GetTpm2HID(
-   CHAR8 *HID,
+   CHAR8 *Hid,
    UINTN  Size
   )
 {
@@ -401,7 +401,7 @@ GetTpm2HID(
 
   PnpHID = TRUE;
 
-  ZeroMem(HID, Size);
+  ZeroMem(Hid, Size);
 
   //
   // Get Manufacturer ID
@@ -418,13 +418,13 @@ GetTpm2HID(
       //  HID containing PNP ID "NNN####"
       //   NNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 3);
+      CopyMem(Hid, &ManufacturerID, 3);
     } else {
       //
       //  HID containing ACP ID "NNNN####"
       //   NNNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 4);
+      CopyMem(Hid, &ManufacturerID, 4);
       PnpHID = FALSE;
     }
   } else {
@@ -441,9 +441,9 @@ GetTpm2HID(
     //   #### is Firmware Version 1
     //
     if (PnpHID) {
-      AsciiSPrint(HID + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     } else {
-      AsciiSPrint(HID + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     }
 
   } else {
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index 968f327..3ca6958 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -317,7 +317,7 @@ UpdateHID (
 {
   EFI_STATUS  Status;
   UINT8       *DataPtr;
-  CHAR8       HID[TPM_HID_ACPI_SIZE];
+  CHAR8       Hid[TPM_HID_ACPI_SIZE];
   UINT32      ManufacturerID;
   UINT32      FirmwareVersion1;
   UINT32      FirmwareVersion2;
@@ -328,7 +328,7 @@ UpdateHID (
   //
   // Initialize HID with Default PNP string
   //
-  ZeroMem(HID, TPM_HID_ACPI_SIZE);
+  ZeroMem(Hid, TPM_HID_ACPI_SIZE);
 
   //
   // Get Manufacturer ID
@@ -345,13 +345,13 @@ UpdateHID (
       //  HID containing PNP ID "NNN####"
       //   NNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 3);
+      CopyMem(Hid, &ManufacturerID, 3);
     } else {
       //
       //  HID containing ACP ID "NNNN####"
       //   NNNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 4);
+      CopyMem(Hid, &ManufacturerID, 4);
       PnpHID = FALSE;
     }
   } else {
@@ -368,9 +368,9 @@ UpdateHID (
     //   #### is Firmware Version 1
     //
     if (PnpHID) {
-      AsciiSPrint(HID + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     } else {
-      AsciiSPrint(HID + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     }
     
   } else {
@@ -387,14 +387,14 @@ UpdateHID (
        DataPtr += 1) {
     if (AsciiStrCmp((CHAR8 *)DataPtr,  TPM_HID_TAG) == 0) {
       if (PnpHID) {
-        CopyMem(DataPtr, HID, TPM_HID_PNP_SIZE);
+        CopyMem(DataPtr, Hid, TPM_HID_PNP_SIZE);
         //
         // if HID is PNP ID, patch the last byte in HID TAG to Noop
         //
         *(DataPtr + TPM_HID_PNP_SIZE) = AML_NOOP_OP;
       } else {
 
-        CopyMem(DataPtr, HID, TPM_HID_ACPI_SIZE);
+        CopyMem(DataPtr, Hid, TPM_HID_ACPI_SIZE);
       }
       DEBUG((DEBUG_INFO, "TPM2 ACPI _HID is patched to %a\n", DataPtr));
 
-- 
1.9.5.msysgit.1



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

* Re: [PATCH 1/2] SecuritPkg: Tcg2: Fix coding style issue
  2017-01-05  2:18 [PATCH 1/2] SecuritPkg: Tcg2: Fix coding style issue Zhang, Chao B
@ 2017-01-05  2:44 ` Bi, Dandan
  0 siblings, 0 replies; 2+ messages in thread
From: Bi, Dandan @ 2017-01-05  2:44 UTC (permalink / raw)
  To: Zhang, Chao B, edk2-devel@lists.01.org; +Cc: Zhang, Chao B

Reviewed-by: Dandan Bi <dandan.bi@intel.com>

Thanks,
Dandan

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang, Chao B
Sent: Thursday, January 5, 2017 10:18 AM
To: edk2-devel@lists.01.org
Cc: Bi, Dandan <dandan.bi@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
Subject: [edk2] [PATCH 1/2] SecuritPkg: Tcg2: Fix coding style issue

Fix coding style issue

Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
---
 SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 14 +++++++-------
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c           | 16 ++++++++--------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
index 3e34155..1317dca 100644
--- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
+++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
@@ -381,7 +381,7 @@ Tcg2RouteConfig (
 /**
   Get HID string of TPM2 ACPI device object
 
-  @param[in]  HID               Points to HID String Buffer.
+  @param[in]  Hid               Points to HID String Buffer.
   @param[in]  Size              HID String size in bytes. Must >= TPM_HID_ACPI_SIZE
 
   @return                       HID String get status.
@@ -389,7 +389,7 @@ Tcg2RouteConfig (
 **/
 EFI_STATUS
 GetTpm2HID(
-   CHAR8 *HID,
+   CHAR8 *Hid,
    UINTN  Size
   )
 {
@@ -401,7 +401,7 @@ GetTpm2HID(
 
   PnpHID = TRUE;
 
-  ZeroMem(HID, Size);
+  ZeroMem(Hid, Size);
 
   //
   // Get Manufacturer ID
@@ -418,13 +418,13 @@ GetTpm2HID(
       //  HID containing PNP ID "NNN####"
       //   NNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 3);
+      CopyMem(Hid, &ManufacturerID, 3);
     } else {
       //
       //  HID containing ACP ID "NNNN####"
       //   NNNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 4);
+      CopyMem(Hid, &ManufacturerID, 4);
       PnpHID = FALSE;
     }
   } else {
@@ -441,9 +441,9 @@ GetTpm2HID(
     //   #### is Firmware Version 1
     //
     if (PnpHID) {
-      AsciiSPrint(HID + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     } else {
-      AsciiSPrint(HID + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     }
 
   } else {
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index 968f327..3ca6958 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -317,7 +317,7 @@ UpdateHID (
 {
   EFI_STATUS  Status;
   UINT8       *DataPtr;
-  CHAR8       HID[TPM_HID_ACPI_SIZE];
+  CHAR8       Hid[TPM_HID_ACPI_SIZE];
   UINT32      ManufacturerID;
   UINT32      FirmwareVersion1;
   UINT32      FirmwareVersion2;
@@ -328,7 +328,7 @@ UpdateHID (
   //
   // Initialize HID with Default PNP string
   //
-  ZeroMem(HID, TPM_HID_ACPI_SIZE);
+  ZeroMem(Hid, TPM_HID_ACPI_SIZE);
 
   //
   // Get Manufacturer ID
@@ -345,13 +345,13 @@ UpdateHID (
       //  HID containing PNP ID "NNN####"
       //   NNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 3);
+      CopyMem(Hid, &ManufacturerID, 3);
     } else {
       //
       //  HID containing ACP ID "NNNN####"
       //   NNNN is uppercase letter for Vendor ID specified by manufacturer
       //
-      CopyMem(HID, &ManufacturerID, 4);
+      CopyMem(Hid, &ManufacturerID, 4);
       PnpHID = FALSE;
     }
   } else {
@@ -368,9 +368,9 @@ UpdateHID (
     //   #### is Firmware Version 1
     //
     if (PnpHID) {
-      AsciiSPrint(HID + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     } else {
-      AsciiSPrint(HID + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
+      AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVersion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF));
     }
     
   } else {
@@ -387,14 +387,14 @@ UpdateHID (
        DataPtr += 1) {
     if (AsciiStrCmp((CHAR8 *)DataPtr,  TPM_HID_TAG) == 0) {
       if (PnpHID) {
-        CopyMem(DataPtr, HID, TPM_HID_PNP_SIZE);
+        CopyMem(DataPtr, Hid, TPM_HID_PNP_SIZE);
         //
         // if HID is PNP ID, patch the last byte in HID TAG to Noop
         //
         *(DataPtr + TPM_HID_PNP_SIZE) = AML_NOOP_OP;
       } else {
 
-        CopyMem(DataPtr, HID, TPM_HID_ACPI_SIZE);
+        CopyMem(DataPtr, Hid, TPM_HID_ACPI_SIZE);
       }
       DEBUG((DEBUG_INFO, "TPM2 ACPI _HID is patched to %a\n", DataPtr));
 
-- 
1.9.5.msysgit.1

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


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

end of thread, other threads:[~2017-01-05  2:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05  2:18 [PATCH 1/2] SecuritPkg: Tcg2: Fix coding style issue Zhang, Chao B
2017-01-05  2:44 ` Bi, Dandan

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