Skip to contentSkip to conversation

efi/riscv: Remove the useless failure return message print

PATCH In review Qiang Ma 4 participants 8 messages Oct 31, 2025 – Nov 26, 2025

Subsystems (2)
lore
Share & tools
lore

Qiang Ma

author
#0 lore raw

PATCH 1/1 efi/riscv: Remove the useless failure return message print

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

---
 drivers/firmware/efi/riscv-runtime.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/firmware/efi/riscv-runtime.c +1 -9
index fa71cd898120..4a2588358be2 100644
@@ -36,20 +36,12 @@ static bool __init efi_virtmap_init(void)
 	init_new_context(NULL, &efi_mm);
 
 	for_each_efi_memory_desc(md) {
-		phys_addr_t phys = md->phys_addr;
-		int ret;
-
 		if (!(md->attribute & EFI_MEMORY_RUNTIME))
 			continue;
 		if (md->virt_addr == U64_MAX)
 			return false;
 
-		ret = efi_create_mapping(&efi_mm, md);
-		if (ret) {
-			pr_warn("  EFI remap %pa: failed to create mapping (%d)\n",
-				&phys, ret);
-			return false;
-		}
+		efi_create_mapping(&efi_mm, md);
 	}
 
 	if (efi_memattr_apply_permissions(&efi_mm, efi_set_mapping_permissions))
Signature · 1 line
2.20.1
#1 lore raw
Quoted 3 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Should we make efi_create_mapping() return void at the same time, if it will never fail?

Regards,
Yao Zi

Quoted 1 line
maintainer
#2 lore raw
Quoted 9 lines · Yao Zi
Quoted 3 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Should we make efi_create_mapping() return void at the same time, if it will never fail?

No.

#3 lore raw
Quoted 7 lines · Ard Biesheuvel
Quoted 6 lines · Yao Zi
Quoted 3 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Quoted 5 lines
Quoted 3 lines

Should we make efi_create_mapping() return void at the same time, if it will never fail?

No.

Oops, seems a silly question here. Sorry for the noise.

Best regards,
Yao Zi

maintainer
#4 lore raw
In reply to Qiang Ma
Quoted 5 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Considering that Ard doesn't think efi_create_mapping() should be changed to remove the return value, and that the ARM version of this code retains the debug message, we should probably keep things the way they are. But if you can get a Reviewed-by: or an Acked-by: from Ard, I'd take it.

Thanks for your patch,

- Paul

author
#5 lore raw
Quoted 11 lines · Paul Walmsley
Quoted 5 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Considering that Ard doesn't think efi_create_mapping() should be changed to remove the return value, and that the ARM version of this code retains the debug message, we should probably keep things the way they are. But if you can get a Reviewed-by: or an Acked-by: from Ard, I'd take it.

Hi, Ard, what are your suggestions for this patch?

Could you add a Reviewed-by: or an Acked-by: to this patch?

Quoted 7 lines

Thanks for your patch,

- Paul

author
#6 lore raw
In reply to Paul Walmsley
Quoted 11 lines · Paul Walmsley
Quoted 5 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Considering that Ard doesn't think efi_create_mapping() should be changed to remove the return value, and that the ARM version of this code retains the debug message, we should probably keep things the way they are. But if you can get a Reviewed-by: or an Acked-by: from Ard, I'd take it.

Hi, Ard, what are your suggestions for this patch?

Could you add a Reviewed-by: or an Acked-by: to this patch?

Quoted 7 lines

Thanks for your patch,

- Paul

maintainer
#7 lore raw
Quoted 9 lines · Qiang Ma
Quoted 6 lines · Paul Walmsley
Quoted 4 lines · Qiang Ma

In the efi_create_mapping() in arch/riscv/kernel/efi.c, the return value is always 0, and this debug message is unnecessary. So, remove it.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Considering that Ard doesn't think efi_create_mapping() should be changed to remove the return value, and that the ARM version of this code retains the debug message, we should probably keep things the way they are. But if you can get a Reviewed-by: or an Acked-by: from Ard, I'd take it.

Hi, Ard, what are your suggestions for this patch?

Could you add a Reviewed-by: or an Acked-by: to this patch?

I already queued this up in efi/next