Skip to contentSkip to conversation

efi/arm64: return zero from ptdump_init()

PATCH In review Qian Cai 2 participants 2 messages Feb 4, 2019 – Feb 5, 2019 EFI

lore
Share & tools
lore

Qian Cai

author
#0 lore raw

PATCH 1/1 efi/arm64: return zero from ptdump_init()

The commit e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions") converted ptdump_debugfs_register() from void, but forgot to fix the efi version of ptdump_init().

drivers/firmware/efi/arm-runtime.c: In function 'ptdump_init':
drivers/firmware/efi/arm-runtime.c:52:9: error: void value not ignored as it ought to be

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

drivers/firmware/efi/arm-runtime.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]

Fixes e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions")
---
 drivers/firmware/efi/arm-runtime.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/firmware/efi/arm-runtime.c +3 -3
index 352bd2473162..b308f5bb3737 100644
@@ -46,10 +46,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.17.2 (Apple Git-113)
#1 lore raw
Quoted 4 lines · Qian Cai

The commit e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions") converted ptdump_debugfs_register() from void, but forgot to fix the efi version of ptdump_init().

Quoted 8 lines

drivers/firmware/efi/arm-runtime.c: In function 'ptdump_init':
drivers/firmware/efi/arm-runtime.c:52:9: error: void value not ignored as it ought to be

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

drivers/firmware/efi/arm-runtime.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]

Fixes e2a2e56e4082 ("arm64: dump: no need to check return value of debugfs_create functions")

A fix is already in -next (commit 67f52a9540e0).

Signature · 1 line
Catalin