git: 707136024fcc - main - stand: remove unnecessary checks for "elfN kernel"

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 24 Jan 2025 21:37:13 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=707136024fcc64be5008c793cdbdd05720be0e18

commit 707136024fcc64be5008c793cdbdd05720be0e18
Author:     Ahmad Khalifa <ahmadkhalifa570@gmail.com>
AuthorDate: 2024-08-22 19:07:59 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-01-24 21:25:52 +0000

    stand: remove unnecessary checks for "elfN kernel"
    
    We never set the kernel type to either "elf64 kernel" nor "elf32
    kernel".
    
    Reviewed by: imp, kib
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
---
 stand/common/bootstrap.h             | 2 +-
 stand/common/gfx_fb.c                | 4 ----
 stand/common/metadata.c              | 4 +---
 stand/efi/loader/bootinfo.c          | 2 --
 stand/i386/libi386/bootinfo32.c      | 2 --
 stand/i386/libi386/bootinfo64.c      | 2 --
 stand/userboot/userboot/bootinfo32.c | 2 --
 stand/userboot/userboot/bootinfo64.c | 2 --
 8 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
index 37cef2956f40..cc198490ac3b 100644
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -230,7 +230,7 @@ struct kernel_module
 struct preloaded_file
 {
 	char *f_name;	/* file name */
-	char *f_type; /* verbose file type, eg 'ELF kernel', 'pnptable', etc. */
+	char *f_type; /* verbose file type, eg 'elf kernel', 'pnptable', etc. */
 	char *f_args;	/* arguments for the file */
 	/* metadata that will be placed in the module directory */
 	struct file_metadata *f_metadata;
diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c
index 9942c629d124..9bda0e7139a9 100644
--- a/stand/common/gfx_fb.c
+++ b/stand/common/gfx_fb.c
@@ -2983,8 +2983,6 @@ build_font_module(vm_offset_t addr)
 	fi.fi_checksum = -checksum;
 
 	fp = file_findfile(NULL, "elf kernel");
-	if (fp == NULL)
-		fp = file_findfile(NULL, "elf64 kernel");
 	if (fp == NULL)
 		panic("can't find kernel file");
 
@@ -3027,8 +3025,6 @@ build_splash_module(vm_offset_t addr)
 	}
 
 	fp = file_findfile(NULL, "elf kernel");
-	if (fp == NULL)
-		fp = file_findfile(NULL, "elf64 kernel");
 	if (fp == NULL)
 		panic("can't find kernel file");
 
diff --git a/stand/common/metadata.c b/stand/common/metadata.c
index f95763bfd01b..8962763061dc 100644
--- a/stand/common/metadata.c
+++ b/stand/common/metadata.c
@@ -146,9 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64)
 #endif
 
     kernend = 0;
-    kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel");
-    if (kfp == NULL)
-	kfp = file_findfile(NULL, "elf kernel");
+    kfp = file_findfile(NULL, "elf kernel");
     if (kfp == NULL)
 	panic("can't find kernel file");
     file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto);
diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
index 99a7b1444aca..b7d4070c2ffb 100644
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -421,8 +421,6 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
 #endif
 
 	kfp = file_findfile(NULL, "elf kernel");
-	if (kfp == NULL)
-		kfp = file_findfile(NULL, "elf64 kernel");
 	if (kfp == NULL)
 		panic("can't find kernel file");
 	kernend = 0;	/* fill it in later */
diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c
index 535849011b6b..df715e547795 100644
--- a/stand/i386/libi386/bootinfo32.c
+++ b/stand/i386/libi386/bootinfo32.c
@@ -130,8 +130,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     addr = roundup(addr, PAGE_SIZE);
 
     kfp = file_findfile(NULL, "elf kernel");
-    if (kfp == NULL)
-      kfp = file_findfile(NULL, "elf32 kernel");
     if (kfp == NULL)
 	panic("can't find kernel file");
     kernend = 0;	/* fill it in later */
diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c
index a55b86eb5ba7..4731b10325fe 100644
--- a/stand/i386/libi386/bootinfo64.c
+++ b/stand/i386/libi386/bootinfo64.c
@@ -144,8 +144,6 @@ bi_load64(char *args, vm_offset_t *modulep,
     module = *modulep = addr;
 
     kfp = file_findfile(NULL, "elf kernel");
-    if (kfp == NULL)
-      kfp = file_findfile(NULL, "elf64 kernel");
     if (kfp == NULL)
 	panic("can't find kernel file");
     kernend = 0;	/* fill it in later */
diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c
index aae94e6a2370..91f1f81f1181 100644
--- a/stand/userboot/userboot/bootinfo32.c
+++ b/stand/userboot/userboot/bootinfo32.c
@@ -109,8 +109,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     addr = roundup(addr, PAGE_SIZE);
 
     kfp = file_findfile(NULL, "elf kernel");
-    if (kfp == NULL)
-      kfp = file_findfile(NULL, "elf32 kernel");
     if (kfp == NULL)
 	panic("can't find kernel file");
     kernend = 0;	/* fill it in later */
diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c
index b7c07e152b8a..fb9fd0fb82f1 100644
--- a/stand/userboot/userboot/bootinfo64.c
+++ b/stand/userboot/userboot/bootinfo64.c
@@ -141,8 +141,6 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp)
     addr = roundup(addr, PAGE_SIZE);
 
     kfp = file_findfile(NULL, "elf kernel");
-    if (kfp == NULL)
-      kfp = file_findfile(NULL, "elf64 kernel");
     if (kfp == NULL)
 	panic("can't find kernel file");
     kernend = 0;	/* fill it in later */