public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems
@ 2020-11-30  5:34 Rebecca Cran
  2020-11-30  5:34 ` [PATCH 1/5] OvmfPkg: Fix BhyveFwCtlLib build with VS2019 Rebecca Cran
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

There are several problems with the code style and formatting in Bhyve related files.
These include using structs without typedef'ing them, wrong indentation (e.g. three
spaces instead of two), and UINTN/UINT32 mix-ups which cause build errors when
using VS 2019.

I've taken this opportunity to also change the INF and DSC versions to decimal and
bump the version to 1.29 for INF files and 1.30 for the DSC.

Rebecca Cran (5):
  OvmfPkg: Fix BhyveFwCtlLib build with VS2019
  OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c
  OvmfPkg: Fix style of BhyveFwCtlLib.inf
  OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h
  OvmfPkg/Bhyve: Fix various style issues

 OvmfPkg/Bhyve/BhyveX64.dsc                    |   2 +-
 .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf |  18 +-
 OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf       |  10 +-
 OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf     |   8 +-
 OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf     |  12 +-
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  10 +-
 .../Library/BhyveFwCtlLib/BhyveFwCtlLib.inf   |   5 +-
 OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h  |  10 +-
 OvmfPkg/Bhyve/AcpiTables/Platform.h           |   2 +-
 OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h               |   6 +-
 OvmfPkg/Bhyve/PlatformPei/Cmos.h              |   6 +-
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.h     |   7 +-
 OvmfPkg/Include/Library/BhyveFwCtlLib.h       |  24 +--
 OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c  |   3 +-
 OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c         |   2 +-
 OvmfPkg/Bhyve/PlatformPei/Fv.c                |   2 +-
 OvmfPkg/Bhyve/PlatformPei/Platform.c          |   2 +-
 OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c | 162 +++++++++---------
 18 files changed, 143 insertions(+), 148 deletions(-)

-- 
2.29.2.windows.2



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

* [PATCH 1/5] OvmfPkg: Fix BhyveFwCtlLib build with VS2019
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
@ 2020-11-30  5:34 ` Rebecca Cran
  2020-11-30  5:34 ` [PATCH 2/5] OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c Rebecca Cran
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

Update BhyveFwCtlLib.c to fix problems with UINT32/UINTN types that
prevented Bhyve from building with VS2019.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c | 50 +++++++++----------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
index 2c45ad70ca71..8804e1df0b3f 100644
--- a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
+++ b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
@@ -40,12 +40,12 @@ STATIC CONST CHAR8 mBhyveSig[4] = { 'B', 'H', 'Y', 'V' };
 
 STATIC BOOLEAN mBhyveFwCtlSupported = FALSE;
 
-STATIC INTN mBhyveFwCtlTxid = 0xa5;
+STATIC INT32 mBhyveFwCtlTxid = 0xa5;
 
 /* XXX Maybe a better inbuilt version of this ? */
 struct BIoVec {
   VOID        *Base;
-  UINTN        Len;
+  UINT32        Len;
 };
 
 struct MsgRxHdr {
@@ -86,14 +86,14 @@ BhyveFwCtl_CvtErr (
 }
 
 STATIC
-UINTN
+UINT32
 EFIAPI
 BIov_WLen (
    IN struct BIoVec b[]
    )
 {
-  UINTN        i;
-  UINTN        tLen;
+  UINT32        i;
+  UINT32        tLen;
 
   tLen = 0;
 
@@ -106,14 +106,14 @@ BIov_WLen (
 }
 
 /**
-   Utility to send 1-3 bhyes of input as a 4-byte value
+   Utility to send 1-3 bytes of input as a 4-byte value
    with trailing zeroes.
  **/
 STATIC
 UINT32
 BIov_Send_Rem (
    IN UINT32        *Data,
-   IN UINTN        Len
+   IN UINT32        Len
    )
 {
   union {
@@ -121,7 +121,7 @@ BIov_Send_Rem (
     UINT32    w;
   } u;
   UINT8        *cdata;
-  UINTN        i;
+  UINT32        i;
 
   cdata = (UINT8 *)Data;
   u.w = 0;
@@ -140,7 +140,7 @@ STATIC
 VOID
 BIov_Send (
   IN char    *Data,
-  IN UINTN    Len
+  IN UINT32    Len
   )
 {
   UINT32    *LData;
@@ -166,7 +166,7 @@ BIov_SendAll (
    IN  struct BIoVec b[]
    )
 {
-  INTN        i;
+  INT32        i;
 
   if (b != NULL) {
     for (i = 0; b[i].Base; i++) {
@@ -182,13 +182,13 @@ STATIC
 VOID
 EFIAPI
 BhyveFwCtl_MsgSend(
-   IN  UINTN    OpCode,
+   IN  UINT32    OpCode,
    IN  struct BIoVec Data[]
    )
 {
   struct BIoVec hIov[4];
   UINT32        Hdr[3];
-  UINTN         i;
+  UINT32         i;
 
   /* Set up header as an iovec */
   for (i = 0; i < 3; i++) {
@@ -200,7 +200,7 @@ BhyveFwCtl_MsgSend(
 
   /* Initialize header */
   Hdr[0] = BIov_WLen (hIov) + BIov_WLen (Data);
-  Hdr[1] = OpCode;
+  Hdr[1] = (UINT32)OpCode;
   Hdr[2] = mBhyveFwCtlTxid;
 
   /* Send header and data */
@@ -222,8 +222,8 @@ BhyveFwCtl_MsgRecv(
   RETURN_STATUS        Status;
   UINT32        *Dp;
   UINT32        Rd;
-  UINTN         remLen;
-  INTN            oLen, xLen;
+  UINT32         remLen;
+  INT32            oLen, xLen;
 
   Rd = IoRead32 (FW_PORT);
   if (Rd < sizeof(struct MsgRxHdr)) {
@@ -283,7 +283,7 @@ STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtl_Msg(
-   IN   UINTN    OpCode,
+   IN   UINT32    OpCode,
    IN   struct BIoVec Sdata[],
    OUT  struct BIoVec Rdata[]
    )
@@ -306,18 +306,18 @@ RETURN_STATUS
 EFIAPI
 BhyveFwCtlGetLen (
   IN   CONST CHAR8    *Name,
-  IN OUT  UINTN        *Size
+  IN OUT  UINT32        *Size
   )
 {
   struct BIoVec        Req[2], Resp[2];
   RETURN_STATUS        Status;
 
   Req[0].Base = (VOID *)Name;
-  Req[0].Len  = AsciiStrLen (Name) + 1;
+  Req[0].Len  = (UINT32)AsciiStrLen (Name) + 1;
   Req[1].Base = NULL;
 
   Resp[0].Base = Size;
-  Resp[0].Len  = sizeof(UINTN);
+  Resp[0].Len  = sizeof(UINT32);
   Resp[1].Base = NULL;
 
   Status = BhyveFwCtl_Msg (OP_GET_LEN, Req, Resp);
@@ -337,7 +337,7 @@ EFIAPI
 BhyveFwCtlGetVal (
   IN   CONST CHAR8    *Name,
   OUT  VOID        *Item,
-  IN OUT  UINTN        *Size
+  IN OUT  UINT32        *Size
   )
 {
   struct BIoVec        Req[2], Resp[2];
@@ -348,7 +348,7 @@ BhyveFwCtlGetVal (
       return RETURN_INVALID_PARAMETER;
 
   Req[0].Base = (VOID *)Name;
-  Req[0].Len  = AsciiStrLen(Name) + 1;
+  Req[0].Len  = (UINT32)AsciiStrLen(Name) + 1;
   Req[1].Base = NULL;
 
   Resp[0].Base = &FwGetvalBuf;
@@ -363,7 +363,7 @@ BhyveFwCtlGetVal (
    *     multiple iovecs.
    */
   if ((Status == RETURN_SUCCESS) || (Status == RETURN_BUFFER_TOO_SMALL)) {
-    *Size = FwGetvalBuf.fSize;
+    *Size = (UINT32)FwGetvalBuf.fSize;
     CopyMem (Item, FwGetvalBuf.fData, *Size);
   }
 
@@ -387,9 +387,9 @@ BhyveFwCtlGet (
     return RETURN_UNSUPPORTED;
 
   if (Item == NULL) {
-    Status = BhyveFwCtlGetLen (Name, Size);
+    Status = BhyveFwCtlGetLen (Name, (UINT32*)Size);
   } else {
-    Status = BhyveFwCtlGetVal (Name, Item, Size);
+    Status = BhyveFwCtlGetVal (Name, Item, (UINT32*)Size);
   }
 
   return Status;
@@ -406,7 +406,7 @@ BhyveFwCtlInitialize (
           VOID
          )
 {
-  UINTN        i;
+  UINT32        i;
   UINT8        ch;
 
   DEBUG ((DEBUG_INFO, "FwCtlInitialize\n"));
-- 
2.29.2.windows.2



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

* [PATCH 2/5] OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
  2020-11-30  5:34 ` [PATCH 1/5] OvmfPkg: Fix BhyveFwCtlLib build with VS2019 Rebecca Cran
@ 2020-11-30  5:34 ` Rebecca Cran
  2020-11-30  5:34 ` [PATCH 3/5] OvmfPkg: Fix style of BhyveFwCtlLib.inf Rebecca Cran
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

The code style in Library/BhyveFwCtlLib/BhyveFwCtlLib.c was very
inconsistent. Fix it to pass the ECC tool checks by typedef'ing
structs, and improve indentation.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c | 136 +++++++++---------
 1 file changed, 69 insertions(+), 67 deletions(-)

diff --git a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
index 8804e1df0b3f..f1f7b2e0d240 100644
--- a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
+++ b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c
@@ -12,27 +12,27 @@
 #include "Uefi.h"
 #include <Library/BaseLib.h>
 #include <Library/BaseMemoryLib.h>
+#include <Library/BhyveFwCtlLib.h>
 #include <Library/DebugLib.h>
 #include <Library/IoLib.h>
-#include <Library/BhyveFwCtlLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/UefiBootServicesTableLib.h>
 
-#define FW_PORT        0x510
-#define FW_IPORT    0x511
+#define FW_PORT    0x510
+#define FW_IPORT   0x511
 
 /* Transport protocol basic operations */
-#define OP_NULL        1
-#define OP_ECHO        2
-#define OP_GET        3
-#define OP_GET_LEN    4
-#define OP_SET        5
+#define OP_NULL      1
+#define OP_ECHO      2
+#define OP_GET       3
+#define OP_GET_LEN   4
+#define OP_SET       5
 
 /* Transport protocol error returns */
-#define T_ESUCCESS    0
+#define T_ESUCCESS  0
 #define T_ENOENT    2
-#define T_E2BIG        7
-#define T_EMSGSIZE    40
+#define T_E2BIG     7
+#define T_EMSGSIZE  40
 
 #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
 
@@ -43,24 +43,24 @@ STATIC BOOLEAN mBhyveFwCtlSupported = FALSE;
 STATIC INT32 mBhyveFwCtlTxid = 0xa5;
 
 /* XXX Maybe a better inbuilt version of this ? */
-struct BIoVec {
-  VOID        *Base;
-  UINT32        Len;
-};
+typedef struct {
+  VOID     *Base;
+  UINT32    Len;
+} BIO_VEC;
 
-struct MsgRxHdr {
+typedef struct {
   UINT32    Sz;
   UINT32    Op;
   UINT32    TxId;
   UINT32    Err;
-};
+} MSG_RX_HDR;
 
 STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtl_CvtErr (
-   IN UINT32    errno
-   )
+  IN UINT32    errno
+  )
 {
   RETURN_STATUS        Status;
 
@@ -89,8 +89,8 @@ STATIC
 UINT32
 EFIAPI
 BIov_WLen (
-   IN struct BIoVec b[]
-   )
+  IN BIO_VEC b[]
+  )
 {
   UINT32        i;
   UINT32        tLen;
@@ -112,9 +112,9 @@ BIov_WLen (
 STATIC
 UINT32
 BIov_Send_Rem (
-   IN UINT32        *Data,
-   IN UINT32        Len
-   )
+  IN UINT32  *Data,
+  IN UINT32   Len
+  )
 {
   union {
     UINT8    c[4];
@@ -140,7 +140,7 @@ STATIC
 VOID
 BIov_Send (
   IN char    *Data,
-  IN UINT32    Len
+  IN UINT32   Len
   )
 {
   UINT32    *LData;
@@ -163,7 +163,7 @@ BIov_Send (
 STATIC
 VOID
 BIov_SendAll (
-   IN  struct BIoVec b[]
+   IN BIO_VEC b[]
    )
 {
   INT32        i;
@@ -182,13 +182,13 @@ STATIC
 VOID
 EFIAPI
 BhyveFwCtl_MsgSend(
-   IN  UINT32    OpCode,
-   IN  struct BIoVec Data[]
-   )
+  IN  UINT32  OpCode,
+  IN  BIO_VEC  Data[]
+  )
 {
-  struct BIoVec hIov[4];
-  UINT32        Hdr[3];
-  UINT32         i;
+  BIO_VEC  hIov[4];
+  UINT32  Hdr[3];
+  UINT32  i;
 
   /* Set up header as an iovec */
   for (i = 0; i < 3; i++) {
@@ -215,18 +215,19 @@ STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtl_MsgRecv(
-   OUT  struct MsgRxHdr    *Rhdr,
-   OUT  struct BIoVec    Data[]
-   )
+  OUT  MSG_RX_HDR *Rhdr,
+  OUT  BIO_VEC    Data[]
+  )
 {
-  RETURN_STATUS        Status;
+  RETURN_STATUS  Status;
   UINT32        *Dp;
-  UINT32        Rd;
+  UINT32         Rd;
   UINT32         remLen;
-  INT32            oLen, xLen;
+  INT32          oLen;
+  INT32          xLen;
 
   Rd = IoRead32 (FW_PORT);
-  if (Rd < sizeof(struct MsgRxHdr)) {
+  if (Rd < sizeof (MSG_RX_HDR)) {
     ;
   }
 
@@ -237,9 +238,9 @@ BhyveFwCtl_MsgRecv(
   Rhdr->Err  = IoRead32 (FW_PORT);
 
   /* Convert transport errno into UEFI error status */
-  Status = BhyveFwCtl_CvtErr(Rhdr->Err);
+  Status = BhyveFwCtl_CvtErr (Rhdr->Err);
 
-  remLen = Rd - sizeof(struct MsgRxHdr);
+  remLen = Rd - sizeof (MSG_RX_HDR);
   xLen = 0;
 
   /*
@@ -258,7 +259,7 @@ BhyveFwCtl_MsgRecv(
     }
     while (remLen > 0) {
       *Dp++ = IoRead32 (FW_PORT);
-      remLen -= sizeof(UINT32);
+      remLen -= sizeof (UINT32);
     }
     Data[0].Len = oLen;
   } else {
@@ -272,7 +273,7 @@ BhyveFwCtl_MsgRecv(
   /* Drop additional data */
   while (xLen > 0) {
     (void) IoRead32 (FW_PORT);
-    xLen -= sizeof(UINT32);
+    xLen -= sizeof (UINT32);
   }
 
   return Status;
@@ -283,13 +284,13 @@ STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtl_Msg(
-   IN   UINT32    OpCode,
-   IN   struct BIoVec Sdata[],
-   OUT  struct BIoVec Rdata[]
+   IN   UINT32 OpCode,
+   IN   BIO_VEC Sdata[],
+   OUT  BIO_VEC Rdata[]
    )
 {
-  struct MsgRxHdr     Rh;
-  RETURN_STATUS        Status;
+  MSG_RX_HDR  Rh;
+  RETURN_STATUS    Status;
 
   Status = RETURN_SUCCESS;
 
@@ -305,19 +306,19 @@ STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtlGetLen (
-  IN   CONST CHAR8    *Name,
-  IN OUT  UINT32        *Size
+  IN CONST CHAR8  *Name,
+  IN OUT   UINT32 *Size
   )
 {
-  struct BIoVec        Req[2], Resp[2];
-  RETURN_STATUS        Status;
+  BIO_VEC         Req[2], Resp[2];
+  RETURN_STATUS  Status;
 
   Req[0].Base = (VOID *)Name;
   Req[0].Len  = (UINT32)AsciiStrLen (Name) + 1;
   Req[1].Base = NULL;
 
   Resp[0].Base = Size;
-  Resp[0].Len  = sizeof(UINT32);
+  Resp[0].Len  = sizeof (UINT32);
   Resp[1].Base = NULL;
 
   Status = BhyveFwCtl_Msg (OP_GET_LEN, Req, Resp);
@@ -335,24 +336,25 @@ STATIC
 RETURN_STATUS
 EFIAPI
 BhyveFwCtlGetVal (
-  IN   CONST CHAR8    *Name,
-  OUT  VOID        *Item,
-  IN OUT  UINT32        *Size
+  IN CONST CHAR8 *Name,
+  OUT      VOID  *Item,
+  IN OUT   UINT32   *Size
   )
 {
-  struct BIoVec        Req[2], Resp[2];
-  RETURN_STATUS        Status;
+  BIO_VEC         Req[2];
+  BIO_VEC         Resp[2];
+  RETURN_STATUS  Status;
 
   /* Make sure temp buffer is larger than passed-in size */
-  if (*Size > sizeof(FwGetvalBuf.fData))
+  if (*Size > sizeof (FwGetvalBuf.fData))
       return RETURN_INVALID_PARAMETER;
 
   Req[0].Base = (VOID *)Name;
-  Req[0].Len  = (UINT32)AsciiStrLen(Name) + 1;
+  Req[0].Len  = (UINT32)AsciiStrLen (Name) + 1;
   Req[1].Base = NULL;
 
   Resp[0].Base = &FwGetvalBuf;
-  Resp[0].Len  = sizeof(UINT64) + *Size;
+  Resp[0].Len  = sizeof (UINT64) + *Size;
   Resp[1].Base = NULL;
 
   Status = BhyveFwCtl_Msg (OP_GET, Req, Resp);
@@ -376,9 +378,9 @@ BhyveFwCtlGetVal (
 RETURN_STATUS
 EFIAPI
 BhyveFwCtlGet (
-  IN   CONST CHAR8    *Name,
+  IN   CONST CHAR8 *Name,
   OUT  VOID        *Item,
-  IN OUT  UINTN        *Size
+  IN OUT  UINTN    *Size
   )
 {
   RETURN_STATUS        Status;
@@ -403,11 +405,11 @@ BhyveFwCtlGet (
 RETURN_STATUS
 EFIAPI
 BhyveFwCtlInitialize (
-          VOID
-         )
+  VOID
+  )
 {
-  UINT32        i;
-  UINT8        ch;
+  UINT32  i;
+  UINT8   ch;
 
   DEBUG ((DEBUG_INFO, "FwCtlInitialize\n"));
 
-- 
2.29.2.windows.2



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

* [PATCH 3/5] OvmfPkg: Fix style of BhyveFwCtlLib.inf
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
  2020-11-30  5:34 ` [PATCH 1/5] OvmfPkg: Fix BhyveFwCtlLib build with VS2019 Rebecca Cran
  2020-11-30  5:34 ` [PATCH 2/5] OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c Rebecca Cran
@ 2020-11-30  5:34 ` Rebecca Cran
  2020-11-30  5:34 ` [PATCH 4/5] OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h Rebecca Cran
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

Fix the order of libraries and update INF_VERSION to 1.29.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.inf | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.inf b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.inf
index 4643de381e04..cf5e55d31334 100644
--- a/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.inf
+++ b/OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.inf
@@ -9,7 +9,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = BhyveFwCtlLib
   FILE_GUID                      = fd982666-67f9-11e5-a42a-0025908602f6
   MODULE_TYPE                    = BASE
@@ -35,7 +35,6 @@ [LibraryClasses]
   BaseLib
   BaseMemoryLib
   DebugLib
+  IntrinsicLib
   IoLib
   MemoryAllocationLib
-  IntrinsicLib
-
-- 
2.29.2.windows.2



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

* [PATCH 4/5] OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
                   ` (2 preceding siblings ...)
  2020-11-30  5:34 ` [PATCH 3/5] OvmfPkg: Fix style of BhyveFwCtlLib.inf Rebecca Cran
@ 2020-11-30  5:34 ` Rebecca Cran
  2020-11-30  5:34 ` [PATCH 5/5] OvmfPkg/Bhyve: Fix various style issues Rebecca Cran
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

There were some problems with the formatting and style that made the
file difficult to read.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Include/Library/BhyveFwCtlLib.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/OvmfPkg/Include/Library/BhyveFwCtlLib.h b/OvmfPkg/Include/Library/BhyveFwCtlLib.h
index 13028ec4b585..07fbd60476d1 100644
--- a/OvmfPkg/Include/Library/BhyveFwCtlLib.h
+++ b/OvmfPkg/Include/Library/BhyveFwCtlLib.h
@@ -8,8 +8,8 @@
 
 **/
 
-#ifndef __BHYVE_FW_CTL_LIB__
-#define __BHYVE_FW_CTL_LIB__
+#ifndef _BHYVE_FW_CTL_LIB_
+#define _BHYVE_FW_CTL_LIB_
 
 /**
   Sysctl-like interface to read host information via a dot-separated
@@ -29,19 +29,19 @@
   @param[]  Data    - return buffer pointer
   @param[]  Size    - pointer to length
 
-  @return    RETURN_SUCCESS          Valid data/len returned.
-          RETURN_UNSUPPORTED        f/w interface not present.
-          RETURN_NOT_FOUND      OID not found.
-        RETURN_BUFFER_TOO_SMALL      Return message truncated.
-        RETURN_INVALID_PARAMETER  Buffer too large
-        RETURN_PROTOCOL_ERROR     Unknown error from host
+  @return RETURN_SUCCESS           Valid data/len returned.
+          RETURN_UNSUPPORTED       f/w interface not present.
+          RETURN_NOT_FOUND         OID not found.
+          RETURN_BUFFER_TOO_SMALL  Return message truncated.
+          RETURN_INVALID_PARAMETER Buffer too large.
+          RETURN_PROTOCOL_ERROR    Unknown error from host.
  **/
 RETURN_STATUS
 EFIAPI
 BhyveFwCtlGet (
-  IN   CONST CHAR8    *Name,
-  OUT  VOID        *Item,
-  IN OUT  UINTN        *Size
+  IN   CONST CHAR8  *Name,
+  OUT  VOID         *Item,
+  IN OUT  UINTN     *Size
   );
 
-#endif
+#endif /* _BHYVE_FW_CTL_LIB_ */
-- 
2.29.2.windows.2



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

* [PATCH 5/5] OvmfPkg/Bhyve: Fix various style issues
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
                   ` (3 preceding siblings ...)
  2020-11-30  5:34 ` [PATCH 4/5] OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h Rebecca Cran
@ 2020-11-30  5:34 ` Rebecca Cran
  2020-11-30  5:37 ` [edk2-devel] [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Peter Grehan
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:34 UTC (permalink / raw)
  To: devel
  Cc: Rebecca Cran, Jordan Justen, Laszlo Ersek, Ard Biesheuvel,
	Peter Grehan

Fix ordering of includes, sources, libraries etc.
Remove leading/trailing underscores from include guards.
Change INF and DSC version numbers to be decimal.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Bhyve/BhyveX64.dsc                     |  2 +-
 .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf  | 18 +++++++++---------
 OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf        | 10 +++++-----
 OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf      |  8 +++-----
 OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf      | 12 ++++++------
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf    | 10 +++++-----
 OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h   | 10 +++-------
 OvmfPkg/Bhyve/AcpiTables/Platform.h            |  2 +-
 OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h                |  6 +++---
 OvmfPkg/Bhyve/PlatformPei/Cmos.h               |  6 +++---
 .../SmbiosPlatformDxe/SmbiosPlatformDxe.h      |  7 +++----
 OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c   |  3 ++-
 OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c          |  2 +-
 OvmfPkg/Bhyve/PlatformPei/Fv.c                 |  2 +-
 OvmfPkg/Bhyve/PlatformPei/Platform.c           |  2 +-
 15 files changed, 47 insertions(+), 53 deletions(-)

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index c9813097ca32..b93fe30ae4e0 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -17,7 +17,7 @@ [Defines]
   PLATFORM_NAME                  = Bhyve
   PLATFORM_GUID                  = 562b76ee-ceb2-4f4f-adfe-a4c8dc46e4ff
   PLATFORM_VERSION               = 0.1
-  DSC_SPECIFICATION              = 0x00010005
+  DSC_SPECIFICATION              = 1.30
   OUTPUT_DIRECTORY               = Build/BhyveX64
   SUPPORTED_ARCHITECTURES        = X64
   BUILD_TARGETS                  = NOOPT|DEBUG|RELEASE
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf
index eec5a42f41e3..595fd055f98a 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -8,7 +8,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = AcpiPlatform
   FILE_GUID                      = D5F92408-BAB5-44CA-8A60-C212F01D7E9D
   MODULE_TYPE                    = DXE_DRIVER
@@ -24,9 +24,9 @@ [Defines]
 [Sources]
   AcpiPlatform.c
   AcpiPlatform.h
+  Bhyve.c
   EntryPoint.c
   PciDecoding.c
-  Bhyve.c
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -35,17 +35,17 @@ [Packages]
   UefiCpuPkg/UefiCpuPkg.dec
 
 [LibraryClasses]
-  UefiLib
-  PcdLib
+  BaseLib
   BaseMemoryLib
-  DebugLib
-  UefiBootServicesTableLib
-  UefiDriverEntryPoint
   BhyveFwCtlLib
-  MemoryAllocationLib
-  BaseLib
+  DebugLib
   DxeServicesTableLib
+  MemoryAllocationLib
   OrderedCollectionLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiLib
 
 [Protocols]
   gEfiAcpiTableProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED
diff --git a/OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf b/OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf
index 3aab42419ca7..f422793f4938 100644
--- a/OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf
+++ b/OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf
@@ -12,7 +12,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = PlatformAcpiTables
   FILE_GUID                      = B4BA6241-936C-4485-A483-9FA832C758CA
   MODULE_TYPE                    = USER_DEFINED
@@ -25,14 +25,14 @@ [Defines]
 #
 
 [Sources]
-  Platform.h
-  Madt.aslc
+  Dsdt.asl
   Facp.aslc
   Facs.aslc
-  Dsdt.asl
   Hpet.aslc
-  Spcr.aslc
+  Madt.aslc
   Mcfg.aslc
+  Platform.h
+  Spcr.aslc
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf b/OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf
index 5d6e41f0575a..d4016605f343 100644
--- a/OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf
+++ b/OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf
@@ -10,7 +10,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = EmuGopDxe
   FILE_GUID                      = 1b290126-5760-424e-8aa2-3faf4d0d7978
   MODULE_TYPE                    = UEFI_DRIVER
@@ -29,12 +29,11 @@ [Defines]
 
 [Sources]
   ComponentName.c
-  GopScreen.c
-  GopDriver.c
   Gop.h
+  GopDriver.c
+  GopScreen.c
   VbeShim.c
 
-
 [Packages]
   MdePkg/MdePkg.dec
   OvmfPkg/OvmfPkg.dec
@@ -55,7 +54,6 @@ [LibraryClasses]
   UefiBootServicesTableLib
   UefiDriverEntryPoint
 
-
 [Protocols]
   gEfiGraphicsOutputProtocolGuid   # PROTOCOL BY_START
   gEfiDevicePathProtocolGuid       # PROTOCOL TO_START
diff --git a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf
index 7288cff4c8a3..12203e9f804d 100644
--- a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf
@@ -11,7 +11,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = PlatformPei
   FILE_GUID                      = aa89d903-345b-4ab2-9abf-030b5efb5d50
   MODULE_TYPE                    = PEIM
@@ -51,15 +51,15 @@ [LibraryClasses]
   DebugLib
   HobLib
   IoLib
+  LocalApicLib
+  MemEncryptSevLib
+  MtrrLib
   PciLib
-  ResourcePublicationLib
+  PeimEntryPoint
   PeiServicesLib
   PeiServicesTablePointerLib
-  PeimEntryPoint
-  MtrrLib
-  MemEncryptSevLib
   PcdLib
-  LocalApicLib
+  ResourcePublicationLib
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index a4cc6e7a565c..12deae7825e6 100644
--- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -10,7 +10,7 @@
 ##
 
 [Defines]
-  INF_VERSION                    = 0x00010005
+  INF_VERSION                    = 1.29
   BASE_NAME                      = SmbiosPlatformDxe
   FILE_GUID                      = e2d8a63c-c239-484f-bb21-2917843cc382
   MODULE_TYPE                    = DXE_DRIVER
@@ -25,9 +25,9 @@ [Defines]
 #
 
 [Sources]
+  Bhyve.c
   SmbiosPlatformDxe.h
   SmbiosPlatformDxe.c
-  Bhyve.c
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -35,14 +35,14 @@ [Packages]
   OvmfPkg/OvmfPkg.dec
 
 [LibraryClasses]
-  UefiBootServicesTableLib
-  BaseMemoryLib
   BaseLib
-  UefiDriverEntryPoint
+  BaseMemoryLib
   DebugLib
   HobLib
   MemoryAllocationLib
   PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
index d30cd11a1dc9..994ee2c7cded 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
@@ -1,5 +1,5 @@
 /** @file
-  Sample ACPI Platform Driver
+  bhyve ACPI Platform Driver
 
   Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
   Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
@@ -11,17 +11,14 @@
 #define _ACPI_PLATFORM_H_INCLUDED_
 
 #include <PiDxe.h>
-
 #include <Protocol/AcpiTable.h>
 #include <Protocol/FirmwareVolume2.h>
 #include <Protocol/PciIo.h>
-
 #include <Library/BaseLib.h>
-#include <Library/UefiBootServicesTableLib.h>
 #include <Library/DebugLib.h>
 #include <Library/PcdLib.h>
+#include <Library/UefiBootServicesTableLib.h>
 #include <Library/XenPlatformLib.h>
-
 #include <IndustryStandard/Acpi.h>
 
 typedef struct {
@@ -73,5 +70,4 @@ RestorePciDecoding (
   IN UINTN               Count
   );
 
-#endif
-
+#endif /* _ACPI_PLATFORM_H_INCLUDED_ */
diff --git a/OvmfPkg/Bhyve/AcpiTables/Platform.h b/OvmfPkg/Bhyve/AcpiTables/Platform.h
index fc43ab411486..c6d43041f36d 100644
--- a/OvmfPkg/Bhyve/AcpiTables/Platform.h
+++ b/OvmfPkg/Bhyve/AcpiTables/Platform.h
@@ -14,8 +14,8 @@
 #define _Platform_h_INCLUDED_
 
 #include <IndustryStandard/Acpi.h>
-#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
 #include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
+#include <IndustryStandard/SerialPortConsoleRedirectionTable.h>
 
 //
 // ACPI table information used to initialize tables.
diff --git a/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h b/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h
index d196a8e6cf93..13cf3976266c 100644
--- a/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h
+++ b/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h
@@ -8,8 +8,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef __UGA_H_
-#define __UGA_H_
+#ifndef _GOP_H_
+#define _GOP_H_
 
 #include <Uefi.h>
 #include <Protocol/GraphicsOutput.h>
@@ -146,4 +146,4 @@ InstallVbeShim (
   IN EFI_PHYSICAL_ADDRESS FrameBufferBase
   );
 
-#endif
+#endif /* _GOP_H_ */
diff --git a/OvmfPkg/Bhyve/PlatformPei/Cmos.h b/OvmfPkg/Bhyve/PlatformPei/Cmos.h
index 3cd98799a3af..ef7901fbeaa8 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Cmos.h
+++ b/OvmfPkg/Bhyve/PlatformPei/Cmos.h
@@ -6,8 +6,8 @@
 
 **/
 
-#ifndef __CMOS_H__
-#define __CMOS_H__
+#ifndef _CMOS_H_
+#define _CMOS_H_
 
 /**
   Reads 8-bits of CMOS data.
@@ -46,5 +46,5 @@ CmosWrite8 (
   );
 
 
-#endif
+#endif /* _CMOS_H_ */
 
diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h
index 1971827be462..12d7be7b2411 100644
--- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h
+++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h
@@ -13,14 +13,13 @@
 #define _SMBIOS_PLATFORM_DXE_H_
 
 #include <PiDxe.h>
-
 #include <Protocol/Smbios.h>
 #include <IndustryStandard/SmBios.h>
-#include <Library/DebugLib.h>
 #include <Library/BaseLib.h>
 #include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DebugLib.h>
 #include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
 
 
 /**
@@ -49,4 +48,4 @@ IsEntryPointStructureValid (
   IN SMBIOS_TABLE_ENTRY_POINT  *EntryPointStructure
   );
 
-#endif
+#endif /* _SMBIOS_PLATFORM_DXE_H_ */
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c
index 31bbf6c474c7..d5c78c61d5ad 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c
@@ -1,8 +1,9 @@
 /** @file
-  OVMF ACPI Platform Driver
+  bhyve ACPI Platform Driver
 
   Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
   Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
+
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c b/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c
index 6d42264b654a..01ee89474667 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c
@@ -9,8 +9,8 @@
 #include "AcpiPlatform.h"
 
 #include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
 #include <Library/BhyveFwCtlLib.h>
+#include <Library/MemoryAllocationLib.h>
 
 STATIC
 EFI_STATUS
diff --git a/OvmfPkg/Bhyve/PlatformPei/Fv.c b/OvmfPkg/Bhyve/PlatformPei/Fv.c
index ee4ecab615f9..94b7e2141562 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Fv.c
+++ b/OvmfPkg/Bhyve/PlatformPei/Fv.c
@@ -10,8 +10,8 @@
 #include "Platform.h"
 #include <Library/DebugLib.h>
 #include <Library/HobLib.h>
-#include <Library/PeiServicesLib.h>
 #include <Library/PcdLib.h>
+#include <Library/PeiServicesLib.h>
 
 
 /**
diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
index 9f1900626d6b..3a414ffcb738 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
+++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c
@@ -21,13 +21,13 @@
 #include <Library/DebugLib.h>
 #include <Library/HobLib.h>
 #include <Library/IoLib.h>
+#include <Library/LocalApicLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/PcdLib.h>
 #include <Library/PciLib.h>
 #include <Library/PeimEntryPoint.h>
 #include <Library/PeiServicesLib.h>
 #include <Library/ResourcePublicationLib.h>
-#include <Library/LocalApicLib.h>
 #include <Guid/MemoryTypeInformation.h>
 #include <Ppi/MasterBootMode.h>
 #include <IndustryStandard/Pci22.h>
-- 
2.29.2.windows.2



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

* Re: [edk2-devel] [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
                   ` (4 preceding siblings ...)
  2020-11-30  5:34 ` [PATCH 5/5] OvmfPkg/Bhyve: Fix various style issues Rebecca Cran
@ 2020-11-30  5:37 ` Peter Grehan
  2020-11-30  5:48 ` Rebecca Cran
  2020-11-30 17:50 ` [edk2-devel] " Laszlo Ersek
  7 siblings, 0 replies; 10+ messages in thread
From: Peter Grehan @ 2020-11-30  5:37 UTC (permalink / raw)
  To: devel, rebecca; +Cc: Jordan Justen, Laszlo Ersek, Ard Biesheuvel

Acked by: Peter Grehan <grehan@freebsd.org>

> There are several problems with the code style and formatting in Bhyve related files.
> These include using structs without typedef'ing them, wrong indentation (e.g. three
> spaces instead of two), and UINTN/UINT32 mix-ups which cause build errors when
> using VS 2019.
> 
> I've taken this opportunity to also change the INF and DSC versions to decimal and
> bump the version to 1.29 for INF files and 1.30 for the DSC.
> 
> Rebecca Cran (5):
>    OvmfPkg: Fix BhyveFwCtlLib build with VS2019
>    OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c
>    OvmfPkg: Fix style of BhyveFwCtlLib.inf
>    OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h
>    OvmfPkg/Bhyve: Fix various style issues
> 
>   OvmfPkg/Bhyve/BhyveX64.dsc                    |   2 +-
>   .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf |  18 +-
>   OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf       |  10 +-
>   OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf     |   8 +-
>   OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf     |  12 +-
>   .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  10 +-
>   .../Library/BhyveFwCtlLib/BhyveFwCtlLib.inf   |   5 +-
>   OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h  |  10 +-
>   OvmfPkg/Bhyve/AcpiTables/Platform.h           |   2 +-
>   OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h               |   6 +-
>   OvmfPkg/Bhyve/PlatformPei/Cmos.h              |   6 +-
>   .../SmbiosPlatformDxe/SmbiosPlatformDxe.h     |   7 +-
>   OvmfPkg/Include/Library/BhyveFwCtlLib.h       |  24 +--
>   OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c  |   3 +-
>   OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c         |   2 +-
>   OvmfPkg/Bhyve/PlatformPei/Fv.c                |   2 +-
>   OvmfPkg/Bhyve/PlatformPei/Platform.c          |   2 +-
>   OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c | 162 +++++++++---------
>   18 files changed, 143 insertions(+), 148 deletions(-)
> 


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

* Re: [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
                   ` (5 preceding siblings ...)
  2020-11-30  5:37 ` [edk2-devel] [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Peter Grehan
@ 2020-11-30  5:48 ` Rebecca Cran
  2020-11-30 16:35   ` Laszlo Ersek
  2020-11-30 17:50 ` [edk2-devel] " Laszlo Ersek
  7 siblings, 1 reply; 10+ messages in thread
From: Rebecca Cran @ 2020-11-30  5:48 UTC (permalink / raw)
  To: devel; +Cc: Jordan Justen, Laszlo Ersek, Ard Biesheuvel, Peter Grehan

On 11/29/2020 10:34 PM, Rebecca Cran wrote:

>   .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf |  18 +-
>   OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf       |  10 +-
>   OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf     |   8 +-
>   OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf     |  12 +-
>   .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  10 +-
>   .../Library/BhyveFwCtlLib/BhyveFwCtlLib.inf   |   5 +-
>   OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h  |  10 +-

Sorry, I thought I'd fixed the ".../" in my .gitconfig but apparently not.

Looks like I need to remember to pass it when running format-patch.


-- 
Rebecca Cran



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

* Re: [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems
  2020-11-30  5:48 ` Rebecca Cran
@ 2020-11-30 16:35   ` Laszlo Ersek
  0 siblings, 0 replies; 10+ messages in thread
From: Laszlo Ersek @ 2020-11-30 16:35 UTC (permalink / raw)
  To: Rebecca Cran, devel; +Cc: Jordan Justen, Ard Biesheuvel, Peter Grehan

On 11/30/20 06:48, Rebecca Cran wrote:
> On 11/29/2020 10:34 PM, Rebecca Cran wrote:
> 
>>   .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf |  18 +-
>>   OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf       |  10 +-
>>   OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf     |   8 +-
>>   OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf     |  12 +-
>>   .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  10 +-
>>   .../Library/BhyveFwCtlLib/BhyveFwCtlLib.inf   |   5 +-
>>   OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h  |  10 +-
> 
> Sorry, I thought I'd fixed the ".../" in my .gitconfig but apparently not.
> 
> Looks like I need to remember to pass it when running format-patch.
> 
> 

Right, unfortunately I don't know a way to make the options "--stat=1000
--stat-graph-width=20" stick. (I guess a git alias command could work,
but I don't like using a different git command for formatting edk2
patches -- it should all be in the settings. Well, OTOH, now I get to
use different *options* when formatting edk2 patches :)))

Thanks
Laszlo


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

* Re: [edk2-devel] [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems
  2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
                   ` (6 preceding siblings ...)
  2020-11-30  5:48 ` Rebecca Cran
@ 2020-11-30 17:50 ` Laszlo Ersek
  7 siblings, 0 replies; 10+ messages in thread
From: Laszlo Ersek @ 2020-11-30 17:50 UTC (permalink / raw)
  To: devel, rebecca; +Cc: Jordan Justen, Ard Biesheuvel, Peter Grehan

On 11/30/20 06:34, Rebecca Cran wrote:
> There are several problems with the code style and formatting in Bhyve related files.
> These include using structs without typedef'ing them, wrong indentation (e.g. three
> spaces instead of two), and UINTN/UINT32 mix-ups which cause build errors when
> using VS 2019.
> 
> I've taken this opportunity to also change the INF and DSC versions to decimal and
> bump the version to 1.29 for INF files and 1.30 for the DSC.
> 
> Rebecca Cran (5):
>   OvmfPkg: Fix BhyveFwCtlLib build with VS2019
>   OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c
>   OvmfPkg: Fix style of BhyveFwCtlLib.inf
>   OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h
>   OvmfPkg/Bhyve: Fix various style issues
> 
>  OvmfPkg/Bhyve/BhyveX64.dsc                    |   2 +-
>  .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf |  18 +-
>  OvmfPkg/Bhyve/AcpiTables/AcpiTables.inf       |  10 +-
>  OvmfPkg/Bhyve/BhyveRfbDxe/BhyveRfbDxe.inf     |   8 +-
>  OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf     |  12 +-
>  .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf   |  10 +-
>  .../Library/BhyveFwCtlLib/BhyveFwCtlLib.inf   |   5 +-
>  OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h  |  10 +-
>  OvmfPkg/Bhyve/AcpiTables/Platform.h           |   2 +-
>  OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h               |   6 +-
>  OvmfPkg/Bhyve/PlatformPei/Cmos.h              |   6 +-
>  .../SmbiosPlatformDxe/SmbiosPlatformDxe.h     |   7 +-
>  OvmfPkg/Include/Library/BhyveFwCtlLib.h       |  24 +--
>  OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c  |   3 +-
>  OvmfPkg/Bhyve/AcpiPlatformDxe/Bhyve.c         |   2 +-
>  OvmfPkg/Bhyve/PlatformPei/Fv.c                |   2 +-
>  OvmfPkg/Bhyve/PlatformPei/Platform.c          |   2 +-
>  OvmfPkg/Library/BhyveFwCtlLib/BhyveFwCtlLib.c | 162 +++++++++---------
>  18 files changed, 143 insertions(+), 148 deletions(-)
> 

series
Acked-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>

Merged as commit range 8501bb0c05ad..9fb629edd75e, via
<https://github.com/tianocore/edk2/pull/1157>.

Thanks,
Laszlo


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

end of thread, other threads:[~2020-11-30 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30  5:34 [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Rebecca Cran
2020-11-30  5:34 ` [PATCH 1/5] OvmfPkg: Fix BhyveFwCtlLib build with VS2019 Rebecca Cran
2020-11-30  5:34 ` [PATCH 2/5] OvmfPkg: Improve code style/formatting in BhyveFwCtlLib.c Rebecca Cran
2020-11-30  5:34 ` [PATCH 3/5] OvmfPkg: Fix style of BhyveFwCtlLib.inf Rebecca Cran
2020-11-30  5:34 ` [PATCH 4/5] OvmfPkg: Improve style and formatting in BhyveFwCtlLib.h Rebecca Cran
2020-11-30  5:34 ` [PATCH 5/5] OvmfPkg/Bhyve: Fix various style issues Rebecca Cran
2020-11-30  5:37 ` [edk2-devel] [PATCH 0/5] OvmfPkg: Fix Bhyve code formatting and style problems Peter Grehan
2020-11-30  5:48 ` Rebecca Cran
2020-11-30 16:35   ` Laszlo Ersek
2020-11-30 17:50 ` [edk2-devel] " Laszlo Ersek

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