]> Gentwo Git Trees - linux/.git/commitdiff
efi/memattr: Convert efi_memattr_init() return type to void
authorBreno Leitao <leitao@debian.org>
Fri, 10 Oct 2025 10:44:04 +0000 (03:44 -0700)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 11 Nov 2025 18:11:12 +0000 (19:11 +0100)
The efi_memattr_init() function's return values (0 and -ENOMEM) are never
checked by callers. Convert the function to return void since the return
status is unused.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/memattr.c
include/linux/efi.h

index c38b1a335590d4f6b75012414a936e66f22dcd9a..e727cc5909cb676c47d787ab0d7754b6fdcb493d 100644 (file)
@@ -19,19 +19,19 @@ unsigned long __ro_after_init efi_mem_attr_table = EFI_INVALID_TABLE_ADDR;
  * Reserve the memory associated with the Memory Attributes configuration
  * table, if it exists.
  */
-int __init efi_memattr_init(void)
+void __init efi_memattr_init(void)
 {
        efi_memory_attributes_table_t *tbl;
        unsigned long size;
 
        if (efi_mem_attr_table == EFI_INVALID_TABLE_ADDR)
-               return 0;
+               return;
 
        tbl = early_memremap(efi_mem_attr_table, sizeof(*tbl));
        if (!tbl) {
                pr_err("Failed to map EFI Memory Attributes table @ 0x%lx\n",
                       efi_mem_attr_table);
-               return -ENOMEM;
+               return;
        }
 
        if (tbl->version > 2) {
@@ -61,7 +61,6 @@ int __init efi_memattr_init(void)
 
 unmap:
        early_memunmap(tbl, sizeof(*tbl));
-       return 0;
 }
 
 /*
index a98cc39e7aaa830d75d6394b416efe79b84fa536..0b9eb3d2ff977b60a179a9087919fbad4c5461ab 100644 (file)
@@ -772,7 +772,7 @@ extern unsigned long efi_mem_attr_table;
  */
 typedef int (*efi_memattr_perm_setter)(struct mm_struct *, efi_memory_desc_t *, bool);
 
-extern int efi_memattr_init(void);
+extern void efi_memattr_init(void);
 extern int efi_memattr_apply_permissions(struct mm_struct *mm,
                                         efi_memattr_perm_setter fn);