The code after the "if" statement is only reachable if the first branch
with the "break" is not taken. Therefore we can move the "else" branch
after the "if" statement, simplifying the code.

Cc: Eric Dong <[email protected]>
Cc: Feng Tian <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Star Zeng <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <[email protected]>
---
 MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c 
b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
index 72e3da8967b2..1068770cd87f 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
@@ -1332,11 +1332,12 @@ DiscoverScsiDevice (
               FALSE
               );
     if (!EFI_ERROR (Status)) {
       break;
-    } else if ((Status == EFI_BAD_BUFFER_SIZE) || 
-               (Status == EFI_INVALID_PARAMETER) ||
-               (Status == EFI_UNSUPPORTED)) {
+    }
+    if ((Status == EFI_BAD_BUFFER_SIZE) ||
+        (Status == EFI_INVALID_PARAMETER) ||
+        (Status == EFI_UNSUPPORTED)) {
       ScsiDeviceFound = FALSE;
       goto Done;
     }
   }
-- 
2.14.1.3.gb7cf6e02401b


_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to