From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 257BE21E79033 for ; Thu, 17 Aug 2017 20:35:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88F3637EEF; Fri, 18 Aug 2017 03:38:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 88F3637EEF Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-49.phx2.redhat.com [10.3.116.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC0DB60FB6; Fri, 18 Aug 2017 03:38:04 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Eric Dong , Feng Tian , Hannes Reinecke , Paolo Bonzini , Star Zeng Date: Fri, 18 Aug 2017 05:37:56 +0200 Message-Id: <20170818033757.16153-3-lersek@redhat.com> In-Reply-To: <20170818033757.16153-1-lersek@redhat.com> References: <20170818033757.16153-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 18 Aug 2017 03:38:06 +0000 (UTC) Subject: [PATCH 2/3] MdeModulePkg/ScsiBusDxe: remove redundant "else" after "break" statement X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 03:35:39 -0000 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 Cc: Feng Tian Cc: Hannes Reinecke Cc: Paolo Bonzini Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- 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