Skip to content

Commit 7448e8e

Browse files
ardbiesheuvelIngo Molnar
authored and
Ingo Molnar
committed
x86/boot: Drop redundant code setting the root device
The root device defaults to 0,0 and is no longer configurable at build time [0], so there is no need for the build tool to ever write to this field. [0] 079f85e ("x86, build: Do not set the root_dev field in bzImage") This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8eace5b commit 7448e8e

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

arch/x86/boot/header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ root_flags: .word ROOT_RDONLY
236236
syssize: .long 0 /* Filled in by build.c */
237237
ram_size: .word 0 /* Obsolete */
238238
vid_mode: .word SVGA_MODE
239-
root_dev: .word 0 /* Filled in by build.c */
239+
root_dev: .word 0 /* Default to major/minor 0/0 */
240240
boot_flag: .word 0xAA55
241241

242242
# offset 512, entry point

arch/x86/boot/tools/build.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ typedef unsigned char u8;
4040
typedef unsigned short u16;
4141
typedef unsigned int u32;
4242

43-
#define DEFAULT_MAJOR_ROOT 0
44-
#define DEFAULT_MINOR_ROOT 0
45-
#define DEFAULT_ROOT_DEV (DEFAULT_MAJOR_ROOT << 8 | DEFAULT_MINOR_ROOT)
46-
4743
/* Minimal number of setup sectors */
4844
#define SETUP_SECT_MIN 5
4945
#define SETUP_SECT_MAX 64
@@ -399,9 +395,6 @@ int main(int argc, char ** argv)
399395

400396
update_pecoff_setup_and_reloc(i);
401397

402-
/* Set the default root device */
403-
put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]);
404-
405398
/* Open and stat the kernel file */
406399
fd = open(argv[2], O_RDONLY);
407400
if (fd < 0)

0 commit comments

Comments
 (0)