Patchwork [-next] efi/arm64: return zero from ptdump_init()

login
register
mail settings
Submitter Qian Cai
Date Feb. 4, 2019, 9:01 p.m.
Message ID <20190204210101.61733-1-cai@lca.pw>
Download mbox | patch
Permalink /patch/717887/
State New
Headers show

Comments

Qian Cai - Feb. 4, 2019, 9:01 p.m.
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")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 drivers/firmware/efi/arm-runtime.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Catalin Marinas - Feb. 5, 2019, 9:27 a.m.
On Mon, Feb 04, 2019 at 04:01:01PM -0500, Qian Cai wrote:
> 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")
> Signed-off-by: Qian Cai <cai@lca.pw>

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

Patch

diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 352bd2473162..b308f5bb3737 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -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);