]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/ScsiBusDxe: remove redundant "else" after "break" statement
authorLaszlo Ersek <lersek@redhat.com>
Fri, 18 Aug 2017 02:07:01 +0000 (04:07 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 18 Aug 2017 22:39:01 +0000 (00:39 +0200)
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 <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c

index 72e3da8967b2ed70aeb525ce3c1fc1f9b028e5cc..1068770cd87f02903ca28e31b4ae94da09487fcc 100644 (file)
@@ -1333,9 +1333,10 @@ DiscoverScsiDevice (
               );\r
     if (!EFI_ERROR (Status)) {\r
       break;\r
               );\r
     if (!EFI_ERROR (Status)) {\r
       break;\r
-    } else if ((Status == EFI_BAD_BUFFER_SIZE) || \r
-               (Status == EFI_INVALID_PARAMETER) ||\r
-               (Status == EFI_UNSUPPORTED)) {\r
+    }\r
+    if ((Status == EFI_BAD_BUFFER_SIZE) ||\r
+        (Status == EFI_INVALID_PARAMETER) ||\r
+        (Status == EFI_UNSUPPORTED)) {\r
       ScsiDeviceFound = FALSE;\r
       goto Done;\r
     }\r
       ScsiDeviceFound = FALSE;\r
       goto Done;\r
     }\r