public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io
Cc: Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Eric Dong <eric.dong@intel.com>
Subject: [edk2-platforms][PATCH v1 2/2] MinPlatformPkg/BoardAcpiTableLibNull: Improve maintainability
Date: Wed,  7 Apr 2021 11:33:24 -0700	[thread overview]
Message-ID: <20210407183324.1659-3-mikuback@linux.microsoft.com> (raw)
In-Reply-To: <20210407183324.1659-1-mikuback@linux.microsoft.com>

From: Michael Kubacki <michael.kubacki@microsoft.com>

The NULL instance of BoardAcpiTableLib in MinPlatformPkg currently
has a few organization issues that make it more difficult to find
and use than a typical NULL library instance.

1. It shares a directory with another unrelated library instance.
2. The directory name "BoardAcpiLibNull" is not directly related to
   either library instance name in the directory.
3. The library instance has unnecessary dependencies.
4. The BASE_NAME does not indicate the library instance is the NULL
   instance.
5. The C source file name does not match the INF file name making
   finding the C source by search more cumbersome than needed.

This change resolves the above issues to improve use and
maintainability.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 Platform/Intel/MinPlatformPkg/Acpi/Library/{BoardAcpiLibNull/BoardAcpiTableLib.c => BoardAcpiTableLibNull/BoardAcpiTableLibNull.c} |  4 +---
 Platform/Intel/MinPlatformPkg/Acpi/Library/{BoardAcpiLibNull => BoardAcpiTableLibNull}/BoardAcpiTableLibNull.inf                   | 12 ++++--------
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                                                                   |  4 ++--
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.c
similarity index 73%
rename from Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLib.c
rename to Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.c
index e49e6ad44162..0f871b6f07ef 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLib.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.c
@@ -5,10 +5,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
+#include <Base.h>
 #include <Library/BoardAcpiTableLib.h>
-#include <Library/BoardAcpiEnableLib.h>
-#include <Library/PcdLib.h>
-#include <Library/DebugLib.h>
 
 EFI_STATUS
 EFIAPI
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf b/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.inf
similarity index 67%
rename from Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf
rename to Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.inf
index 04f55b49d5a1..6102897ab67b 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.inf
@@ -1,7 +1,8 @@
 ## @file
-# Component information file for Board Acpi Library
+# Component information file for NULL instance of the Board ACPI Enable library
 #
 # Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -9,20 +10,15 @@
 
 [Defines]
   INF_VERSION                    = 0x00010005
-  BASE_NAME                      = BoardAcpiTableLib
+  BASE_NAME                      = BoardAcpiTableLibNull
   FILE_GUID                      = F220FAB7-F8E4-4E7A-A599-D47E2D547956
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = BoardAcpiTableLib
 
-[LibraryClasses]
-  BaseLib
-  PcdLib
-  DebugLib
-
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
   MdePkg/MdePkg.dec
 
 [Sources]
-  BoardAcpiTableLib.c
+  BoardAcpiTableLibNull.c
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index da27aa1c4227..cf3ff13e7b29 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -78,7 +78,7 @@ [LibraryClasses.common]
   FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
 
   BoardInitLib|MinPlatformPkg/PlatformInit/Library/BoardInitLibNull/BoardInitLibNull.inf
-  BoardAcpiTableLib|MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf
+  BoardAcpiTableLib|MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.inf
   BoardAcpiEnableLib|MinPlatformPkg/Acpi/Library/BoardAcpiEnableLibNull/BoardAcpiEnableLibNull.inf
   SiliconPolicyInitLib|MinPlatformPkg/PlatformInit/Library/SiliconPolicyInitLibNull/SiliconPolicyInitLibNull.inf
   SiliconPolicyUpdateLib|MinPlatformPkg/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf
@@ -151,7 +151,7 @@ [Components]
   MinPlatformPkg/Acpi/AcpiSmm/AcpiStandaloneMm.inf
   MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf
   MinPlatformPkg/Acpi/Library/BoardAcpiEnableLibNull/BoardAcpiEnableLibNull.inf
-  MinPlatformPkg/Acpi/Library/BoardAcpiLibNull/BoardAcpiTableLibNull.inf
+  MinPlatformPkg/Acpi/Library/BoardAcpiTableLibNull/BoardAcpiTableLibNull.inf
   MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
   MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf
 
-- 
2.28.0.windows.1


  parent reply	other threads:[~2021-04-07 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 18:33 [edk2-platforms][PATCH v1 0/2] MinPlatformPkg: Improve NULL ACPI table lib maintainability Michael Kubacki
2021-04-07 18:33 ` [edk2-platforms][PATCH v1 1/2] MinPlatformPkg/BoardAcpiEnableLibNull: Improve maintainability Michael Kubacki
2021-04-08  0:29   ` [edk2-devel] " Nate DeSimone
2021-04-07 18:33 ` Michael Kubacki [this message]
2021-04-08  0:29   ` [edk2-platforms][PATCH v1 2/2] MinPlatformPkg/BoardAcpiTableLibNull: " Nate DeSimone
2021-04-08 21:26     ` [edk2-devel] " Michael Kubacki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407183324.1659-3-mikuback@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox