Skip to content

Commit 1b72691

Browse files
Andi KleenIngo Molnar
authored andcommitted
x86: fix build warnings in real mode code
This recent patch commit c3965bd Author: Paul Jackson <[email protected]> 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. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent f710666 commit 1b72691

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

arch/x86/boot/boot.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
/* Useful macros */
3131
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
3232

33+
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
34+
3335
extern struct setup_header hdr;
3436
extern struct boot_params boot_params;
3537

arch/x86/boot/memory.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515
#include "boot.h"
16-
#include <linux/kernel.h>
1716

1817
#define SMAP 0x534d4150 /* ASCII "SMAP" */
1918

0 commit comments

Comments
 (0)