public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
@ 2008-02-21 19:50 Cyrill Gorcunov
  2008-02-21 19:52 ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2008-02-21 19:50 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: LKML

This patch replaces 4096 numeric constant with PAGE_SIZE macro.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

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(-)


Index: linux-2.6.git/arch/x86/boot/main.c
===================================================================
--- linux-2.6.git.orig/arch/x86/boot/main.c	2008-02-09 22:27:13.000000000 +0300
+++ linux-2.6.git/arch/x86/boot/main.c	2008-02-21 22:28:10.000000000 +0300
@@ -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 &&

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
  2008-02-21 19:50 [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code Cyrill Gorcunov
@ 2008-02-21 19:52 ` H. Peter Anvin
  2008-02-21 19:56   ` Cyrill Gorcunov
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2008-02-21 19:52 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Ingo Molnar, Thomas Gleixner, LKML

Cyrill Gorcunov wrote:
> This patch replaces 4096 numeric constant with PAGE_SIZE macro.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
  2008-02-21 19:52 ` H. Peter Anvin
@ 2008-02-21 19:56   ` Cyrill Gorcunov
  2008-02-21 19:59     ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2008-02-21 19:56 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, LKML

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]
> Cyrill Gorcunov wrote:
>> This patch replaces 4096 numeric constant with PAGE_SIZE macro.
>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>> ---
>> 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
>

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

		- Cyrill -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
  2008-02-21 19:56   ` Cyrill Gorcunov
@ 2008-02-21 19:59     ` H. Peter Anvin
  2008-02-21 20:00       ` Cyrill Gorcunov
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2008-02-21 19:59 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Ingo Molnar, Thomas Gleixner, LKML

Cyrill Gorcunov wrote:
> [H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]
>> Cyrill Gorcunov wrote:
>>> This patch replaces 4096 numeric constant with PAGE_SIZE macro.
>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>>> ---
>>> 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
>>
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
  2008-02-21 19:59     ` H. Peter Anvin
@ 2008-02-21 20:00       ` Cyrill Gorcunov
  2008-02-21 20:05         ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2008-02-21 20:00 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, LKML

[H. Peter Anvin - Thu, Feb 21, 2008 at 11:59:28AM -0800]
> Cyrill Gorcunov wrote:
>> [H. Peter Anvin - Thu, Feb 21, 2008 at 11:52:56AM -0800]
>>> Cyrill Gorcunov wrote:
>>>> This patch replaces 4096 numeric constant with PAGE_SIZE macro.
>>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>>>> ---
>>>> 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
>>>
>> 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 -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code
  2008-02-21 20:00       ` Cyrill Gorcunov
@ 2008-02-21 20:05         ` H. Peter Anvin
  0 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2008-02-21 20:05 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Ingo Molnar, Thomas Gleixner, LKML

Cyrill Gorcunov wrote:
> 
> Thanks Peter, my fault.
> 

No problem; this is why we do reviews :)

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-21 20:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 19:50 [PATCH] x86: cleanup - use PAGE_SIZE instead of numeric constant in boot code Cyrill Gorcunov
2008-02-21 19:52 ` H. Peter Anvin
2008-02-21 19:56   ` Cyrill Gorcunov
2008-02-21 19:59     ` H. Peter Anvin
2008-02-21 20:00       ` Cyrill Gorcunov
2008-02-21 20:05         ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox