* [PATCH] x86: fix two modpost warnings
@ 2008-07-18 12:37 Jan Beulich
2008-07-18 21:34 ` H. Peter Anvin
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2008-07-18 12:37 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: linux-kernel
Even though it's only the difference of the two __initdata symbols
that's being calculated, modpost still doesn't like this. So rather
calculate the size once in an __init function and store it for later
use.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/x86/vdso/vma.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- linux-2.6.26/arch/x86/vdso/vma.c 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.26-x86-modpost-warnings/arch/x86/vdso/vma.c 2008-07-15 14:51:28.000000000 +0200
@@ -21,7 +21,8 @@ int vdso_enabled = 1;
extern char vdso_start[], vdso_end[];
extern unsigned short vdso_sync_cpuid;
-struct page **vdso_pages;
+static struct page **vdso_pages;
+static unsigned vdso_size;
static inline void *var_ref(void *p, char *name)
{
@@ -38,6 +39,7 @@ static int __init init_vdso_vars(void)
int i;
char *vbase;
+ vdso_size = npages << PAGE_SHIFT;
vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
if (!vdso_pages)
goto oom;
@@ -101,20 +103,19 @@ int arch_setup_additional_pages(struct l
struct mm_struct *mm = current->mm;
unsigned long addr;
int ret;
- unsigned len = round_up(vdso_end - vdso_start, PAGE_SIZE);
if (!vdso_enabled)
return 0;
down_write(&mm->mmap_sem);
- addr = vdso_addr(mm->start_stack, len);
- addr = get_unmapped_area(NULL, addr, len, 0, 0);
+ addr = vdso_addr(mm->start_stack, vdso_size);
+ addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
if (IS_ERR_VALUE(addr)) {
ret = addr;
goto up_fail;
}
- ret = install_special_mapping(mm, addr, len,
+ ret = install_special_mapping(mm, addr, vdso_size,
VM_READ|VM_EXEC|
VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
VM_ALWAYSDUMP,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86: fix two modpost warnings
2008-07-18 12:37 [PATCH] x86: fix two modpost warnings Jan Beulich
@ 2008-07-18 21:34 ` H. Peter Anvin
0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2008-07-18 21:34 UTC (permalink / raw)
To: Jan Beulich; +Cc: mingo, tglx, linux-kernel
Jan Beulich wrote:
> Even though it's only the difference of the two __initdata symbols
> that's being calculated, modpost still doesn't like this. So rather
> calculate the size once in an __init function and store it for later
> use.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
Applied to x86/cleanups, thanks!
-hpa
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-18 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 12:37 [PATCH] x86: fix two modpost warnings Jan Beulich
2008-07-18 21:34 ` 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;
as well as URLs for NNTP newsgroup(s).