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

Michael D Kinney posted 1 patch 3 weeks, 1 day ago
Failed in applying to current master (apply log)
.../Feature/VTd/IntelVTdDmarPei/TranslationTable.c              | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [Patch] IntelSiliconPkg/IntelVTdDmarPei: Fix CLANG detected incorrect return
Posted by Michael D Kinney 3 weeks, 1 day ago
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@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../Feature/VTd/IntelVTdDmarPei/TranslationTable.c              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
index a806c4c000..bb121a608e 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
@@ -109,7 +109,7 @@ CreateSecondLevelPagingEntryTable (
   BOOLEAN                               Is5LevelPaging;
 
   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 (#96424): https://edk2.groups.io/g/devel/message/96424
Mute This Topic: https://groups.io/mt/95062535/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch] IntelSiliconPkg/IntelVTdDmarPei: Fix CLANG detected incorrect return
Posted by Ashraf Ali S 3 weeks, 1 day ago
Reviewed-by: S, Ashraf Ali <ashraf.ali.s@intel.com>

Regards,
Ashraf Ali S
Intel Technology India Pvt. Ltd. 

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Wednesday, November 16, 2022 1:54 PM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Oram, Isaac W <isaac.w.oram@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>
Subject: [Patch] IntelSiliconPkg/IntelVTdDmarPei: 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@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../Feature/VTd/IntelVTdDmarPei/TranslationTable.c              | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
index a806c4c000..bb121a608e 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Translat
+++ ionTable.c
@@ -109,7 +109,7 @@ CreateSecondLevelPagingEntryTable (
   BOOLEAN                               Is5LevelPaging;
 
   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 (#96426): https://edk2.groups.io/g/devel/message/96426
Mute This Topic: https://groups.io/mt/95062535/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch] IntelSiliconPkg/IntelVTdDmarPei: Fix CLANG detected incorrect return
Posted by Ni, Ray 3 weeks, 1 day ago
Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, November 16, 2022 4:24 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>
> Subject: [Patch] IntelSiliconPkg/IntelVTdDmarPei: 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@intel.com>
> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  .../Feature/VTd/IntelVTdDmarPei/TranslationTable.c              | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
> b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
> index a806c4c000..bb121a608e 100644
> --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/TranslationTable.c
> @@ -109,7 +109,7 @@ CreateSecondLevelPagingEntryTable (
>    BOOLEAN                               Is5LevelPaging;
> 
>    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 (#96425): https://edk2.groups.io/g/devel/message/96425
Mute This Topic: https://groups.io/mt/95062535/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-