Skip to content

Commit 52cccc6

Browse files
author
Ingo Molnar
committed
x86/boot: Clean up the arch/x86/boot/main.c code a bit
- Don't line break user-visible strings - Use consistent comment style - Remove unnecessary col80 line breaks Signed-off-by: Ingo Molnar <[email protected]> Cc: Uros Bizjak <[email protected]> Cc: [email protected]
1 parent b855cc5 commit 52cccc6

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

arch/x86/boot/main.c

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,32 @@ char *heap_end = _end; /* Default end of heap = no heap */
2727
* screws up the old-style command line protocol, adjust by
2828
* filling in the new-style command line pointer instead.
2929
*/
30-
3130
static void copy_boot_params(void)
3231
{
3332
struct old_cmdline {
3433
u16 cl_magic;
3534
u16 cl_offset;
3635
};
37-
const struct old_cmdline * const oldcmd =
38-
absolute_pointer(OLD_CL_ADDRESS);
36+
const struct old_cmdline * const oldcmd = absolute_pointer(OLD_CL_ADDRESS);
3937

4038
BUILD_BUG_ON(sizeof(boot_params) != 4096);
4139
memcpy(&boot_params.hdr, &hdr, sizeof(hdr));
4240

43-
if (!boot_params.hdr.cmd_line_ptr &&
44-
oldcmd->cl_magic == OLD_CL_MAGIC) {
45-
/* Old-style command line protocol. */
41+
if (!boot_params.hdr.cmd_line_ptr && oldcmd->cl_magic == OLD_CL_MAGIC) {
42+
/* Old-style command line protocol */
4643
u16 cmdline_seg;
4744

48-
/* Figure out if the command line falls in the region
49-
of memory that an old kernel would have copied up
50-
to 0x90000... */
45+
/*
46+
* Figure out if the command line falls in the region
47+
* of memory that an old kernel would have copied up
48+
* to 0x90000...
49+
*/
5150
if (oldcmd->cl_offset < boot_params.hdr.setup_move_size)
5251
cmdline_seg = ds();
5352
else
5453
cmdline_seg = 0x9000;
5554

56-
boot_params.hdr.cmd_line_ptr =
57-
(cmdline_seg << 4) + oldcmd->cl_offset;
55+
boot_params.hdr.cmd_line_ptr = (cmdline_seg << 4) + oldcmd->cl_offset;
5856
}
5957
}
6058

@@ -66,6 +64,7 @@ static void copy_boot_params(void)
6664
static void keyboard_init(void)
6765
{
6866
struct biosregs ireg, oreg;
67+
6968
initregs(&ireg);
7069

7170
ireg.ah = 0x02; /* Get keyboard status */
@@ -83,8 +82,10 @@ static void query_ist(void)
8382
{
8483
struct biosregs ireg, oreg;
8584

86-
/* Some older BIOSes apparently crash on this call, so filter
87-
it from machines too old to have SpeedStep at all. */
85+
/*
86+
* Some older BIOSes apparently crash on this call, so filter
87+
* it from machines too old to have SpeedStep at all.
88+
*/
8889
if (cpu.level < 6)
8990
return;
9091

@@ -119,16 +120,13 @@ static void init_heap(void)
119120
char *stack_end;
120121

121122
if (boot_params.hdr.loadflags & CAN_USE_HEAP) {
122-
stack_end = (char *)
123-
(current_stack_pointer - STACK_SIZE);
124-
heap_end = (char *)
125-
((size_t)boot_params.hdr.heap_end_ptr + 0x200);
123+
stack_end = (char *) (current_stack_pointer - STACK_SIZE);
124+
heap_end = (char *) ((size_t)boot_params.hdr.heap_end_ptr + 0x200);
126125
if (heap_end > stack_end)
127126
heap_end = stack_end;
128127
} else {
129128
/* Boot protocol 2.00 only, no heap available */
130-
puts("WARNING: Ancient bootloader, some functionality "
131-
"may be limited!\n");
129+
puts("WARNING: Ancient bootloader, some functionality may be limited!\n");
132130
}
133131
}
134132

@@ -149,12 +147,11 @@ void main(void)
149147

150148
/* Make sure we have all the proper CPU support */
151149
if (validate_cpu()) {
152-
puts("Unable to boot - please use a kernel appropriate "
153-
"for your CPU.\n");
150+
puts("Unable to boot - please use a kernel appropriate for your CPU.\n");
154151
die();
155152
}
156153

157-
/* Tell the BIOS what CPU mode we intend to run in. */
154+
/* Tell the BIOS what CPU mode we intend to run in */
158155
set_bios_mode();
159156

160157
/* Detect memory layout */

0 commit comments

Comments
 (0)