[edk2-devel] [Patch edk2-platforms] IntelSiliconPkg/IntelVTdDxe: Fix CLANG detected incorrect return

Chaganty, Rangasai V rangasai.v.chaganty at intel.com
Thu Nov 10 19:33:11 UTC 2022


Reviewed-by: Sai Chaganty <rangasai.v.chaganty at intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney at intel.com> 
Sent: Thursday, November 10, 2022 10:24 AM
To: devel at edk2.groups.io
Cc: Ni, Ray <ray.ni at intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty at intel.com>; Oram, Isaac W <isaac.w.oram at intel.com>; S, Ashraf Ali <ashraf.ali.s at intel.com>
Subject: [Patch edk2-platforms] IntelSiliconPkg/IntelVTdDxe: Fix CLANG detected incorrect return

CreateSecondLevelPagingEntryTable() has a return type of VTD_SECOND_LEVEL_PAGING_ENTRY * and an error condition returns a value of NULL.

Change return value of EFI_SUCCESS (value 0) to NULL to address CLANG compiler detection of incorrect return type.

Cc: Ray Ni <ray.ni at intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty at intel.com>
Cc: Isaac Oram <isaac.w.oram at intel.com>
Cc: Ashraf Ali S <ashraf.ali.s at intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
---
 .../IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
index 3220789080..6788c86531 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationT
+++ able.c
@@ -196,7 +196,7 @@ CreateSecondLevelPagingEntryTable (
   UINT64                         EndAddress;
 
   if (MemoryLimit == 0) {
-    return EFI_SUCCESS;
+    return NULL;
   }
 
   Lvl4PagesStart = 0;
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96206): https://edk2.groups.io/g/devel/message/96206
Mute This Topic: https://groups.io/mt/94942403/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list