git: 742ad212c5bd - stable/13 - stand: Remove dead store to bi_kernelname

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:12:40 UTC
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=742ad212c5bdc8e75a7ff58f0c21757cd010cb61

commit 742ad212c5bdc8e75a7ff58f0c21757cd010cb61
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-16 15:09:02 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:35 +0000

    stand: Remove dead store to bi_kernelname
    
    We set this value twice: once to 0 and once to the VA that has the name
    of the kernel. The first store is redundant. In addition, these two
    stores of 0 are also redundant. Since we never set them, they will
    always be zero, even if we're called multiple times. This saves 21
    bytes on BIOS loader.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D36541
    
    (cherry picked from commit e895ab3fbdc10fbf944289165c25357cb3f279fe)
---
 stand/i386/libi386/bootinfo32.c      | 3 ---
 stand/userboot/userboot/bootinfo32.c | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c
index 9ca6a70d674e..68aae9b67ba9 100644
--- a/stand/i386/libi386/bootinfo32.c
+++ b/stand/i386/libi386/bootinfo32.c
@@ -173,9 +173,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     kernelname = getenv("kernelname");
     i386_getdev(NULL, kernelname, &kernelpath);
     bi.bi_version = BOOTINFO_VERSION;
-    bi.bi_kernelname = 0;		/* XXX char * -> kernel name */
-    bi.bi_nfs_diskless = 0;		/* struct nfs_diskless * */
-    bi.bi_n_bios_used = 0;		/* XXX would have to hook biosdisk driver for these */
     for (i = 0; i < N_BIOS_GEOM; i++)
         bi.bi_bios_geom[i] = bd_getbigeom(i);
     bi.bi_size = sizeof(bi);
diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c
index 08dde13baa30..d496384fbcb5 100644
--- a/stand/userboot/userboot/bootinfo32.c
+++ b/stand/userboot/userboot/bootinfo32.c
@@ -152,9 +152,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t
     kernelname = getenv("kernelname");
     userboot_getdev(NULL, kernelname, &kernelpath);
     bi.bi_version = BOOTINFO_VERSION;
-    bi.bi_kernelname = 0;		/* XXX char * -> kernel name */
-    bi.bi_nfs_diskless = 0;		/* struct nfs_diskless * */
-    bi.bi_n_bios_used = 0;		/* XXX would have to hook biosdisk driver for these */
 #if 0
     for (i = 0; i < N_BIOS_GEOM; i++)
         bi.bi_bios_geom[i] = bd_getbigeom(i);