public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ranbir.Singh3@Dell.com
To: devel@edk2.groups.io
Subject: [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue
Date: Thu, 22 Dec 2022 02:05:51 -0800	[thread overview]
Message-ID: <99a4.1671703551972754272.yj0B@groups.io> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 139 bytes --]

Hi All,

The attached patch fixes the DEADCODE issue in MdeModulePkg/Bus/Ata/AhciPei.

Please review.

Best Regards,
Ranbir Singh

[-- Attachment #1.2: Type: text/html, Size: 171 bytes --]

[-- Attachment #2: 0001-MdeModulePkg-Bus-Ata-AhciPei-Fix-DEADCODE-Coverity-i.patch --]
[-- Type: text/plain, Size: 1082 bytes --]

From 10175e59ad725db9f499b6f57ab43524c624715c Mon Sep 17 00:00:00 2001
From: Ranbir Singh <Ranbir.Singh3@Dell.com>
Date: Thu, 22 Dec 2022 13:42:39 +0530
Subject: [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4201

The code can reach line 69 only through the else path above at line 57.
The else path already has the same NULL check at line 59 and hence the
duplicate code lines are totally redundant which can be deleted.

Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com>
---
 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
index 42e4203a22..6013af858d 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
@@ -66,10 +66,6 @@ AhciS3GetEumeratePorts (
     }
   }
 
-  if (S3InitDevices == NULL) {
-    return 0;
-  }
-
   //
   // Only enumerate the ports that exist in the device list.
   //
-- 
2.36.1.windows.1


             reply	other threads:[~2022-12-22 10:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 10:05 Ranbir.Singh3 [this message]
2022-12-30  1:36 ` 回复: [edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue gaoliming
2023-01-04  4:49   ` [edk2-devel] " Ranbir Singh

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=99a4.1671703551972754272.yj0B@groups.io \
    --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