[edk2] [Patch] MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout

fanwang2 posted 1 patch 6 years, 4 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[edk2] [Patch] MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout
Posted by fanwang2 6 years, 4 months ago
From: Wang Fan <fan.wang@intel.com>

Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
---
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index d75cca2..26a80a7 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2526,11 +2526,10 @@ Exit:
                                 MediaState pointer is NULL.
   @retval EFI_DEVICE_ERROR      A device error occurred.
   @retval EFI_TIMEOUT           Network is connecting but timeout.
 
 **/
-
 EFI_STATUS
 EFIAPI
 NetLibDetectMediaWaitTimeout (
   IN  EFI_HANDLE            ServiceHandle,
   IN  UINT64                Timeout,
@@ -2571,11 +2570,11 @@ NetLibDetectMediaWaitTimeout (
   if (EFI_ERROR (Status)) {
 
     MediaPresent = TRUE;
     Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);
     if (!EFI_ERROR (Status)) {
-      if (MediaPresent == TRUE) {
+      if (MediaPresent) {
         *MediaState = EFI_SUCCESS;
       } else {
         *MediaState = EFI_NO_MEDIA;
       }
     }
@@ -2612,11 +2611,11 @@ NetLibDetectMediaWaitTimeout (
       // If gEfiAdapterInfoMediaStateGuid is not supported, call NetLibDetectMedia to get media state!
       //
       MediaPresent = TRUE;
       Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);
       if (!EFI_ERROR (Status)) {
-        if (MediaPresent == TRUE) {
+        if (MediaPresent) {
           *MediaState = EFI_SUCCESS;
         } else {
           *MediaState = EFI_NO_MEDIA;
         }
       }
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout
Posted by Bi, Dandan 6 years, 4 months ago
Reviewed-by: Dandan Bi <dandan.bi@intel.com>

Thanks,
Dandan
-----Original Message-----
From: Wang, Fan 
Sent: Monday, December 25, 2017 10:46 AM
To: edk2-devel@lists.01.org
Cc: Wang, Fan <fan.wang@intel.com>; Bi, Dandan <dandan.bi@intel.com>
Subject: [Patch] MdeModulePkg/NetLib: Refine coding style for API NetLibDetectMediaWaitTimeout

From: Wang Fan <fan.wang@intel.com>

Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
---
 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
index d75cca2..26a80a7 100644
--- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
+++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
@@ -2526,11 +2526,10 @@ Exit:
                                 MediaState pointer is NULL.
   @retval EFI_DEVICE_ERROR      A device error occurred.
   @retval EFI_TIMEOUT           Network is connecting but timeout.
 
 **/
-
 EFI_STATUS
 EFIAPI
 NetLibDetectMediaWaitTimeout (
   IN  EFI_HANDLE            ServiceHandle,
   IN  UINT64                Timeout,
@@ -2571,11 +2570,11 @@ NetLibDetectMediaWaitTimeout (
   if (EFI_ERROR (Status)) {
 
     MediaPresent = TRUE;
     Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);
     if (!EFI_ERROR (Status)) {
-      if (MediaPresent == TRUE) {
+      if (MediaPresent) {
         *MediaState = EFI_SUCCESS;
       } else {
         *MediaState = EFI_NO_MEDIA;
       }
     }
@@ -2612,11 +2611,11 @@ NetLibDetectMediaWaitTimeout (
       // If gEfiAdapterInfoMediaStateGuid is not supported, call NetLibDetectMedia to get media state!
       //
       MediaPresent = TRUE;
       Status = NetLibDetectMedia (ServiceHandle, &MediaPresent);
       if (!EFI_ERROR (Status)) {
-        if (MediaPresent == TRUE) {
+        if (MediaPresent) {
           *MediaState = EFI_SUCCESS;
         } else {
           *MediaState = EFI_NO_MEDIA;
         }
       }
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel