Skip to contentSkip to conversation

efi/arm: Don't expect a return value of ptdump_debugfs_register

PATCH In review Nathan Chancellor 3 participants 3 messages Feb 1, 2019 – Feb 4, 2019 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi/arm: Don't expect a return value of ptdump_debugfs_register

As of commit e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions") in the arm64 for-next/core branch, ptdump_debugfs_register does not have a return value, which causes a build error here:

drivers/firmware/efi/arm-runtime.c:51:9: error: returning 'void' from a function with incompatible result type 'int'

        return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

The arm version is still awaiting acceptance [1] but in anticipation of that patch being merged, restructure this function to call ptdump_debugfs_register without expecting a return value.

[1]: https://lore.kernel.org/lkml/[email protected]/

---
 drivers/firmware/efi/arm-runtime.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/efi/arm-runtime.c +3 -3
index 23ea1ed409d1..7ae3b797caf8 100644
@@ -45,10 +45,10 @@ static struct ptdump_info efi_ptdump_info = {
 
 static int __init ptdump_init(void)
 {
-	if (!efi_enabled(EFI_RUNTIME_SERVICES))
-		return 0;
+	if (efi_enabled(EFI_RUNTIME_SERVICES))
+		ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
 
-	return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
+	return 0;
 }
 device_initcall(ptdump_init);
 
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Nathan Chancellor

As of commit e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions") in the arm64 for-next/core branch, ptdump_debugfs_register does not have a return value, which causes a build error here:

drivers/firmware/efi/arm-runtime.c:51:9: error: returning 'void' from a function with incompatible result type 'int'

        return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

Quoted 7 lines

The arm version is still awaiting acceptance [1] but in anticipation of that patch being merged, restructure this function to call ptdump_debugfs_register without expecting a return value.

[1]: https://lore.kernel.org/lkml/[email protected]/

Catalin, Will,

Could you please apply this directly?

Quoted 25 lines
---
 drivers/firmware/efi/arm-runtime.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/efi/arm-runtime.c +3 -4
index 23ea1ed409d1..7ae3b797caf8 100644
@@ -45,10 +45,10 @@ static struct ptdump_info efi_ptdump_info = {
 
 static int __init ptdump_init(void)
 {
-       if (!efi_enabled(EFI_RUNTIME_SERVICES))
-               return 0;
+       if (efi_enabled(EFI_RUNTIME_SERVICES))
+               ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
 
-       return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
+       return 0;
 }
 device_initcall(ptdump_init);
 
--

2.20.1

#2 lore raw
Quoted 19 lines · Ard Biesheuvel
Quoted 18 lines · Nathan Chancellor

As of commit e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions") in the arm64 for-next/core branch, ptdump_debugfs_register does not have a return value, which causes a build error here:

drivers/firmware/efi/arm-runtime.c:51:9: error: returning 'void' from a function with incompatible result type 'int'

        return ptdump_debugfs_register(&efi_ptdump_info, "efi_page_tables");
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

The arm version is still awaiting acceptance [1] but in anticipation of that patch being merged, restructure this function to call ptdump_debugfs_register without expecting a return value.

[1]: https://lore.kernel.org/lkml/[email protected]/

Quoted 8 lines
Quoted 1 line

Catalin, Will,

Could you please apply this directly?

Sure, we'll pick it up.

Will