Discussion:
[edk2] [PATCH] MdePkg: Make the implementation of UefiFileHandleLib instance consistent with comments in header file.
Qiu Shumin
1970-01-01 00:00:00 UTC
Permalink
The comment for FileHandleIsDirectory in FileHandleLib.h states that "If DirHandle is NULL, then ASSERT()." But the instance of UefiFileHandleLib returns EFI_INVALID_PARAMETER. The patch makes the comments and the implementation consistent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index be66c57..724532a 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -385,7 +385,7 @@ FileHandleFlush (
/**
function to determine if a given handle is a directory handle

- if DirHandle is NULL then return error
+ if DirHandle is NULL, then ASSERT().

open the file information on the DirHandle and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
@@ -404,9 +404,7 @@ FileHandleIsDirectory (
{
EFI_FILE_INFO *DirInfo;

- if (DirHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
+ ASSERT (DirHandle != NULL);

//
// get the file information for DirHandle
--
1.9.5.msysgit.1



------------------------------------------------------------------------------
Carsey, Jaben
2015-06-10 04:18:00 UTC
Permalink
Can you say return "EFI_INVALID_PARAMETER" instead of "error"
-----Original Message-----
Sent: Tuesday, June 09, 2015 8:04 PM
Subject: [edk2] [PATCH] MdePkg: Make the implementation of
UefiFileHandleLib instance consistent with comments in header file.
The comment for FileHandleIsDirectory in FileHandleLib.h states that "If
DirHandle is NULL, then ASSERT()." But the instance of UefiFileHandleLib
returns EFI_INVALID_PARAMETER. The patch makes the comments and the
implementation consistent.
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index be66c57..724532a 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -385,7 +385,7 @@ FileHandleFlush (
/**
function to determine if a given handle is a directory handle
- if DirHandle is NULL then return error
+ if DirHandle is NULL, then ASSERT().
open the file information on the DirHandle and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
@@ -404,9 +404,7 @@ FileHandleIsDirectory (
{
EFI_FILE_INFO *DirInfo;
- if (DirHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
+ ASSERT (DirHandle != NULL);
//
// get the file information for DirHandle
--
1.9.5.msysgit.1
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Loading...