public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: edk2-devel@ml01.01.org
Cc: Feng Tian <feng.tian@intel.com>, Star Zeng <star.zeng@intel.com>
Subject: [PATCH] MdeModulePkg: Remove superfluous return statements
Date: Thu, 19 Jan 2017 11:16:04 +0100	[thread overview]
Message-ID: <1484820964-30276-1-git-send-email-thuth@redhat.com> (raw)

If the code eventually returns "Status" anyway, it does not make
sense to explicitely return "Status" in case of an error, too.
(this patch has been created with Coccinelle)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c          | 3 ---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c             | 3 ---
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c                | 3 ---
 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 3 ---
 4 files changed, 12 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
index 51cff3c..ad6cdb1 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -1046,9 +1046,6 @@ NvmeControllerInit (
   // One for blocking I/O, one for non-blocking I/O.
   //
   Status = NvmeCreateIoSubmissionQueue (Private);
-  if (EFI_ERROR(Status)) {
-   return Status;
-  }
 
   return Status;
 }
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
index 3f73194..9dbec10 100755
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
@@ -783,9 +783,6 @@ EmmcSwitchToHighSpeed (
 
   HsTiming = 1;
   Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming, ClockFreq);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
 
   return Status;
 }
diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c
index d6d3bdb..5a9e0b2 100644
--- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c
+++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c
@@ -2520,9 +2520,6 @@ EmmcPeimSwitchToHighSpeed (
 
   HsTiming = 1;
   Status = EmmcPeimSwitchClockFreq (Slot, Rca, HsTiming, ClockFreq);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
 
   return Status;
 }
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 7ef141f..01bec19 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -1465,9 +1465,6 @@ ConSplitterStdErrDriverBindingStart (
   //
   Status = ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL, NULL);
   ConSplitterTextOutSetAttribute (&mStdErr.TextOut, EFI_TEXT_ATTR (EFI_MAGENTA, EFI_BLACK));
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
 
   return Status;
 }
-- 
1.8.3.1



             reply	other threads:[~2017-01-19 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 10:16 Thomas Huth [this message]
2017-01-19 10:22 ` [PATCH] MdeModulePkg: Remove superfluous return statements Zeng, Star
2017-01-20  5:58   ` Thomas Huth
2017-01-20  6:02     ` Zeng, Star
2017-01-20  7:31       ` Zeng, Star

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484820964-30276-1-git-send-email-thuth@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox