[edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue

Ranbir Singh via groups.io posted 1 patch 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/99a4.1671703551972754272.yj0B@groups.io
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c | 4 ----
1 file changed, 4 deletions(-)
[edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue
Posted by Ranbir Singh via groups.io 1 year, 4 months ago
Hi All,

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

Please review.

Best Regards,
Ranbir Singh


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97760): https://edk2.groups.io/g/devel/message/97760
Mute This Topic: https://groups.io/mt/95897177/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


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

回复: [edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue
Posted by gaoliming via groups.io 1 year, 4 months ago
Ranbir:

 This change is good. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Ranbir Singh via groups.io
发送时间: 2022年12月22日 18:06
收件人: devel@edk2.groups.io
主题: [edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue

 

Hi All,

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

Please review.

Best Regards,
Ranbir Singh 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97816): https://edk2.groups.io/g/devel/message/97816
Mute This Topic: https://groups.io/mt/95947546/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] 回复: [edk2-devel] [PATCH] MdeModulePkg/Bus/Ata/AhciPei: Fix DEADCODE Coverity issue
Posted by Ranbir Singh via groups.io 1 year, 3 months ago
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.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4201
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97910): https://edk2.groups.io/g/devel/message/97910
Mute This Topic: https://groups.io/mt/95947546/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-