summaryrefslogtreecommitdiff
path: root/IntelFrameworkPkg/Library/FrameworkUefiLib
diff options
context:
space:
mode:
authorgdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-04 08:06:07 +0000
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-04 08:06:07 +0000
commit409f118c84e20b8ca4287dea403585d319b7466c (patch)
tree2f4c11655bd30ff24aea1e2123566ef2b425a26f /IntelFrameworkPkg/Library/FrameworkUefiLib
parent3a306c100673a9be5c8481361671b7ed5e2c4495 (diff)
downloadedk2-409f118c84e20b8ca4287dea403585d319b7466c.zip
edk2-409f118c84e20b8ca4287dea403585d319b7466c.tar.gz
edk2-409f118c84e20b8ca4287dea403585d319b7466c.tar.bz2
Replace some CopyMem() for GUID copy with CopyGuid().
Replace some gBS->FreePool() with FreePool(). Add EFIAPI modifier. Removed inconsistent OPTIONAL modifier. Coding style issue fix. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7176 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkPkg/Library/FrameworkUefiLib')
-rw-r--r--IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c29
-rw-r--r--IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c36
2 files changed, 28 insertions, 37 deletions
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
index fd223f4..1a59374 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
@@ -12,9 +12,6 @@
**/
-
-
-
#include "UefiLibInternal.h"
typedef struct {
@@ -199,30 +196,29 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {
@retval 0 The width if UnicodeChar could not be determined.
@retval 1 UnicodeChar is a narrow glyph.
@retval 2 UnicodeChar is a wide glyph.
-
**/
UINTN
EFIAPI
GetGlyphWidth (
- IN CHAR16 UnicodeChar
+ IN CHAR16 UnicodeChar
)
{
- UINTN Index;
- UINTN Low;
- UINTN High;
- CONST UNICODE_WIDTH_ENTRY *Item;
+ UINTN Index;
+ UINTN Low;
+ UINTN High;
+ CONST UNICODE_WIDTH_ENTRY *Item;
Item = NULL;
Low = 0;
High = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;
- while (Low <= High) {
+
+ while (Low <= High) {
Index = (Low + High) >> 1;
Item = &(mUnicodeWidthTable[Index]);
if (Index == 0) {
if (UnicodeChar <= Item->WChar) {
break;
}
-
return 0;
}
@@ -256,19 +252,18 @@ GetGlyphWidth (
characters that are width glyphs have a width of 2.
If String is not aligned on a 16-bit boundary, then ASSERT().
- @param String A pointer to a Null-terminated Unicode string.
+ @param String A pointer to a Null-terminated Unicode string.
- @return The display length of the Null-terminated Unicode string specified by String.
-
+ @return The display length of the Null-terminated Unicode string specified by String.
**/
UINTN
EFIAPI
UnicodeStringDisplayLength (
- IN CONST CHAR16 *String
+ IN CONST CHAR16 *String
)
{
- UINTN Length;
- UINTN Width;
+ UINTN Length;
+ UINTN Width;
if (String == NULL) {
return 0;
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c
index 28037b6..ce54c93 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c
@@ -13,7 +13,6 @@
**/
-
#include "UefiLibInternal.h"
/**
@@ -36,18 +35,17 @@
@retval EFI_SUCCESS The protocol installation is completed successfully.
@retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.
@retval Others Status from gBS->InstallMultipleProtocolInterfaces().
-
**/
EFI_STATUS
EFIAPI
EfiLibInstallDriverBinding (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle
+ IN CONST EFI_HANDLE ImageHandle,
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
+ IN EFI_HANDLE DriverBindingHandle
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
ASSERT (DriverBinding != NULL);
@@ -56,9 +54,6 @@ EfiLibInstallDriverBinding (
&gEfiDriverBindingProtocolGuid, DriverBinding,
NULL
);
- //
- // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
- //
ASSERT_EFI_ERROR (Status);
//
@@ -70,7 +65,6 @@ EfiLibInstallDriverBinding (
return Status;
}
-
/**
Installs and completes the initialization of a Driver Binding Protocol instance and
optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
@@ -109,9 +103,11 @@ EfiLibInstallAllDriverProtocols (
IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
- ASSERT (DriverBinding != NULL);
+ if (DriverBinding == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
if (DriverConfiguration == NULL) {
@@ -229,15 +225,15 @@ EfiLibInstallAllDriverProtocols (
EFI_STATUS
EFIAPI
EfiLibInstallDriverBindingComponentName2 (
- IN CONST EFI_HANDLE ImageHandle,
- IN CONST EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
- IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL
+ IN CONST EFI_HANDLE ImageHandle,
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
+ IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
ASSERT (DriverBinding != NULL);