linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix new warnings in real mode code
@ 2008-08-18  7:06 Andi Kleen
  2008-08-18  7:20 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2008-08-18  7:06 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Andi Kleen, Paul Jackson, mingo, hpa

From: Andi Kleen <ak@linux.intel.com>

This recent patch

commit c3965bd15118742d72b4bc1a290d37b3f081eb98
Author: Paul Jackson <pj@sgi.com>
Date:   Wed May 14 08:15:34 2008 -0700

    x86 boot: proper use of ARRAY_SIZE instead of repeated E820MAX constant

caused these new warnings during a normal build:

In file included from linux-2.6/arch/x86/boot/memory.c:17:
linux-2.6/include/linux/log2.h: In function '__ilog2_u32':
linux-2.6/include/linux/log2.h:34: warning: implicit declaration of function 'fls'
linux-2.6/include/linux/log2.h: In function '__ilog2_u64':
linux-2.6/include/linux/log2.h:42: warning: implicit declaration of function 'fls64'
linux-2.6/include/linux/log2.h: In function '__roundup_pow_of_two ':
linux-2.6/include/linux/log2.h:63: warning: implicit declaration of function 'fls_long'

I tried to fix them in log2.h, but it's difficult because the real mode
environment is completely different from a normal kernel environment. Instead
define an own ARRAY_SIZE macro in boot.h, similar to the other private
macros there.

Cc: Paul Jackson <pj@sgi.com>
Cc: mingo@elte.hu
Cc: hpa@zytor.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/boot/boot.h   |    2 ++
 arch/x86/boot/memory.c |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 616b804..cc0ef13 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -30,6 +30,8 @@
 /* Useful macros */
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
 
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
+
 extern struct setup_header hdr;
 extern struct boot_params boot_params;
 
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 53165c9..8c3c25f 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -13,7 +13,6 @@
  */
 
 #include "boot.h"
-#include <linux/kernel.h>
 
 #define SMAP	0x534d4150	/* ASCII "SMAP" */
 
-- 
1.5.6


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

* Re: [PATCH] Fix new warnings in real mode code
  2008-08-18  7:06 [PATCH] Fix new warnings in real mode code Andi Kleen
@ 2008-08-18  7:20 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-08-18  7:20 UTC (permalink / raw)
  To: Andi Kleen
  Cc: torvalds, linux-kernel, Andi Kleen, Paul Jackson, hpa, Thomas Gleixner


* Andi Kleen <andi@firstfloor.org> wrote:

> This recent patch
> 
> commit c3965bd15118742d72b4bc1a290d37b3f081eb98
> Author: Paul Jackson <pj@sgi.com>
> Date:   Wed May 14 08:15:34 2008 -0700
> 
>     x86 boot: proper use of ARRAY_SIZE instead of repeated E820MAX constant
> 
> caused these new warnings during a normal build:
> 
> In file included from linux-2.6/arch/x86/boot/memory.c:17:
> linux-2.6/include/linux/log2.h: In function '__ilog2_u32':
> linux-2.6/include/linux/log2.h:34: warning: implicit declaration of function 'fls'

applied to tip/x86/urgent, thanks.

	Ingo

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

end of thread, other threads:[~2008-08-18  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-18  7:06 [PATCH] Fix new warnings in real mode code Andi Kleen
2008-08-18  7:20 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).