Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi/memattr: Convert efi_memattr_init() return type to void

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>

authored by

Breno Leitao and committed by
Ard Biesheuvel
cb46a58d 793b1354

+4 -5
+3 -4
drivers/firmware/efi/memattr.c
··· 19 19 * Reserve the memory associated with the Memory Attributes configuration 20 20 * table, if it exists. 21 21 */ 22 - int __init efi_memattr_init(void) 22 + void __init efi_memattr_init(void) 23 23 { 24 24 efi_memory_attributes_table_t *tbl; 25 25 unsigned long size; 26 26 27 27 if (efi_mem_attr_table == EFI_INVALID_TABLE_ADDR) 28 - return 0; 28 + return; 29 29 30 30 tbl = early_memremap(efi_mem_attr_table, sizeof(*tbl)); 31 31 if (!tbl) { 32 32 pr_err("Failed to map EFI Memory Attributes table @ 0x%lx\n", 33 33 efi_mem_attr_table); 34 - return -ENOMEM; 34 + return; 35 35 } 36 36 37 37 if (tbl->version > 2) { ··· 61 61 62 62 unmap: 63 63 early_memunmap(tbl, sizeof(*tbl)); 64 - return 0; 65 64 } 66 65 67 66 /*
+1 -1
include/linux/efi.h
··· 772 772 */ 773 773 typedef int (*efi_memattr_perm_setter)(struct mm_struct *, efi_memory_desc_t *, bool); 774 774 775 - extern int efi_memattr_init(void); 775 + extern void efi_memattr_init(void); 776 776 extern int efi_memattr_apply_permissions(struct mm_struct *mm, 777 777 efi_memattr_perm_setter fn); 778 778