Discussion:
[edk2] [PATCH] MdePkg: Refine the comments for FileHandleIsDirectory.
Qiu Shumin
2015-06-12 02:18:25 UTC
Permalink
Make the function comments of FileHandleIsDirectory in FileHandleLib consistent with instance implementation.

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

diff --git a/MdePkg/Include/Library/FileHandleLib.h b/MdePkg/Include/Library/FileHandleLib.h
index 123cc8c..9c2d056 100644
--- a/MdePkg/Include/Library/FileHandleLib.h
+++ b/MdePkg/Include/Library/FileHandleLib.h
@@ -1,7 +1,7 @@
/** @file
Provides interface to EFI_FILE_HANDLE functionality.

- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -242,7 +242,7 @@ FileHandleFlush (
/**
Function to determine if a given handle is a directory handle.

- If DirHandle is NULL, then ASSERT().
+ If DirHandle is NULL then return EFI_INVALID_PARAMETER.

Open the file information on the DirHandle, and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index be66c57..089f610 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -1,7 +1,7 @@
/** @file
Provides interface to EFI_FILE_HANDLE functionality.

- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -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 return EFI_INVALID_PARAMETER

open the file information on the DirHandle and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
@@ -393,7 +393,8 @@ FileHandleFlush (
@param DirHandle Handle to open file

@retval EFI_SUCCESS DirHandle is a directory
- @retval EFI_INVALID_PARAMETER DirHandle did not have EFI_FILE_INFO available
+ @retval EFI_INVALID_PARAMETER DirHandle is NULL or the file information
+ returns from FileHandleGetInfo is NULL
@retval EFI_NOT_FOUND DirHandle is not a directory
**/
EFI_STATUS
--
1.9.5.msysgit.1



------------------------------------------------------------------------------
Carsey, Jaben
2015-06-12 17:08:52 UTC
Permalink
-----Original Message-----
From: Qiu, Shumin
Sent: Thursday, June 11, 2015 7:18 PM
Cc: Carsey, Jaben; Gao, Liming; Tian, Hot
Subject: [PATCH] MdePkg: Refine the comments for FileHandleIsDirectory.
Importance: High
Make the function comments of FileHandleIsDirectory in FileHandleLib
consistent with instance implementation.
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdePkg/Include/Library/FileHandleLib.h | 4 ++--
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/MdePkg/Include/Library/FileHandleLib.h
b/MdePkg/Include/Library/FileHandleLib.h
index 123cc8c..9c2d056 100644
--- a/MdePkg/Include/Library/FileHandleLib.h
+++ b/MdePkg/Include/Library/FileHandleLib.h
@@ -1,7 +1,7 @@
Provides interface to EFI_FILE_HANDLE functionality.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be
/**
Function to determine if a given handle is a directory handle.
- If DirHandle is NULL, then ASSERT().
+ If DirHandle is NULL then return EFI_INVALID_PARAMETER.
Open the file information on the DirHandle, and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index be66c57..089f610 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -1,7 +1,7 @@
Provides interface to EFI_FILE_HANDLE functionality.
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+ <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be
/**
function to determine if a given handle is a directory handle
- if DirHandle is NULL then return error
+ If DirHandle is NULL then return EFI_INVALID_PARAMETER
open the file information on the DirHandle and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
@@ -393,7 +393,8 @@ FileHandleFlush (
@param DirHandle Handle to open file
@retval EFI_SUCCESS DirHandle is a directory
information
+ returns from FileHandleGetInfo is NULL
@retval EFI_NOT_FOUND DirHandle is not a directory
**/
EFI_STATUS
--
1.9.5.msysgit.1
------------------------------------------------------------------------------
Gao, Liming
2015-06-15 05:29:05 UTC
Permalink
Shumin:
I suggest to move the statement of EFI_INVALID_PARAMETER to @retval, and keep the same function headers in Library header file and Library implementation.

Thanks
Liming
-----Original Message-----
From: Qiu, Shumin
Sent: Friday, June 12, 2015 10:18 AM
To: edk2-***@lists.sourceforge.net
Cc: Carsey, Jaben; Gao, Liming; Tian, Hot
Subject: [PATCH] MdePkg: Refine the comments for FileHandleIsDirectory.

Make the function comments of FileHandleIsDirectory in FileHandleLib consistent with instance implementation.

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

diff --git a/MdePkg/Include/Library/FileHandleLib.h b/MdePkg/Include/Library/FileHandleLib.h
index 123cc8c..9c2d056 100644
--- a/MdePkg/Include/Library/FileHandleLib.h
+++ b/MdePkg/Include/Library/FileHandleLib.h
@@ -1,7 +1,7 @@
/** @file
Provides interface to EFI_FILE_HANDLE functionality.

- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights
+ reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at @@ -242,7 +242,7 @@ FileHandleFlush (
/**
Function to determine if a given handle is a directory handle.

- If DirHandle is NULL, then ASSERT().
+ If DirHandle is NULL then return EFI_INVALID_PARAMETER.

Open the file information on the DirHandle, and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
index be66c57..089f610 100644
--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
@@ -1,7 +1,7 @@
/** @file
Provides interface to EFI_FILE_HANDLE functionality.

- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+ <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at @@ -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 return EFI_INVALID_PARAMETER

open the file information on the DirHandle and verify that the Attribute
includes EFI_FILE_DIRECTORY bit set.
@@ -393,7 +393,8 @@ FileHandleFlush (
@param DirHandle Handle to open file

@retval EFI_SUCCESS DirHandle is a directory
- @retval EFI_INVALID_PARAMETER DirHandle did not have EFI_FILE_INFO available
+ @retval EFI_INVALID_PARAMETER DirHandle is NULL or the file information
+ returns from FileHandleGetInfo is NULL
@retval EFI_NOT_FOUND DirHandle is not a directory
**/
EFI_STATUS
--
1.9.5.msysgit.1



------------------------------------------------------------------------------
Loading...