Skip to contentSkip to conversation

x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code

PATCH NAK Cyrill Gorcunov 2 participants 6 messages Feb 21, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

---

Text segments of old and new files *are* the same so it wouldn't break current kernel.

 main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/boot/main.c +2 -1
Index: linux-2.6.git/arch/x86/boot/main.c
===================================================================
@@ -14,6 +14,7 @@
  * Main module for the real-mode kernel code
  */
 
+#include <asm/page.h>
 #include "boot.h"
 
 struct boot_params boot_params __attribute__((aligned(16)));
@@ -36,7 +37,7 @@ static void copy_boot_params(void)
 	const struct old_cmdline * const oldcmd =
 		(const struct old_cmdline *)OLD_CL_ADDRESS;
 
-	BUILD_BUG_ON(sizeof boot_params != 4096);
+	BUILD_BUG_ON(sizeof boot_params != PAGE_SIZE);
 	memcpy(&boot_params.hdr, &hdr, sizeof hdr);
 
 	if (!boot_params.hdr.cmd_line_ptr &&
reviewer NAK
#1 lore raw
Quoted 8 lines · Cyrill Gorcunov

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

---

Text segments of old and new files *are* the same so it wouldn't break current kernel.

NAK.

This is NOT PAGE_SIZE (even though the two values are coincidentally the same, for historical reasons.)

-hpa

#2 lore raw

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]

Quoted 7 lines
Quoted 5 lines · Cyrill Gorcunov

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

---
Text segments of old and new files *are* the same so it wouldn't break current kernel.

Quoted 7 lines

NAK.

This is NOT PAGE_SIZE (even though the two values are coincidentally the same, for historical reasons.)

-hpa

hmm, why the comment on boot_param structure definition calls it "zeropage"? Anyway really thanks for review and catched this.

- Cyrill -

#3 lore raw
Quoted 9 lines · Cyrill Gorcunov

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]

Quoted 8 lines
Quoted 5 lines · Cyrill Gorcunov

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

---
Text segments of old and new files *are* the same so it wouldn't break current kernel.

NAK.

Quoted 8 lines
Quoted 4 lines

This is NOT PAGE_SIZE (even though the two values are coincidentally the same, for historical reasons.)

-hpa

hmm, why the comment on boot_param structure definition calls it "zeropage"? Anyway really thanks for review and catched this.

Historical reasons... it used to be a "magic page" -- that's long since gone.

-hpa

#4 lore raw

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:59:28AM -0800]

Quoted 15 lines
Quoted 14 lines · Cyrill Gorcunov

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]

Quoted 13 lines
Quoted 5 lines · Cyrill Gorcunov

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

---
Text segments of old and new files *are* the same so it wouldn't break current kernel.

NAK.

This is NOT PAGE_SIZE (even though the two values are coincidentally the same, for historical reasons.)

-hpa

Quoted 8 lines
Quoted 2 lines

hmm, why the comment on boot_param structure definition calls it "zeropage"? Anyway really thanks for review and catched this.

Historical reasons... it used to be a "magic page" -- that's long since gone.

-hpa

Thanks Peter, my fault.

- Cyrill -

#5 lore raw
Quoted 3 lines · Cyrill Gorcunov

Thanks Peter, my fault.

No problem; this is why we do reviews :)

-hpa