Skip to content

Commit cb46a58

Browse files
leitaoardbiesheuvel
authored andcommitted
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>
1 parent 793b135 commit cb46a58

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/firmware/efi/memattr.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ unsigned long __ro_after_init efi_mem_attr_table = EFI_INVALID_TABLE_ADDR;
1919
* Reserve the memory associated with the Memory Attributes configuration
2020
* table, if it exists.
2121
*/
22-
int __init efi_memattr_init(void)
22+
void __init efi_memattr_init(void)
2323
{
2424
efi_memory_attributes_table_t *tbl;
2525
unsigned long size;
2626

2727
if (efi_mem_attr_table == EFI_INVALID_TABLE_ADDR)
28-
return 0;
28+
return;
2929

3030
tbl = early_memremap(efi_mem_attr_table, sizeof(*tbl));
3131
if (!tbl) {
3232
pr_err("Failed to map EFI Memory Attributes table @ 0x%lx\n",
3333
efi_mem_attr_table);
34-
return -ENOMEM;
34+
return;
3535
}
3636

3737
if (tbl->version > 2) {
@@ -61,7 +61,6 @@ int __init efi_memattr_init(void)
6161

6262
unmap:
6363
early_memunmap(tbl, sizeof(*tbl));
64-
return 0;
6564
}
6665

6766
/*

include/linux/efi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ extern unsigned long efi_mem_attr_table;
772772
*/
773773
typedef int (*efi_memattr_perm_setter)(struct mm_struct *, efi_memory_desc_t *, bool);
774774

775-
extern int efi_memattr_init(void);
775+
extern void efi_memattr_init(void);
776776
extern int efi_memattr_apply_permissions(struct mm_struct *mm,
777777
efi_memattr_perm_setter fn);
778778

0 commit comments

Comments
 (0)