[PATCH] x86: cleanup - eliminate numbers in LDT allocation code

Cyrill Gorcunov
2008-02-01T17:14:50Z

This patch eliminates numbers in LDT allocation code
trying to make it clear to understand from where
these numbers are go

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

---

I hope nobody shoot me ;)

Index: linux-2.6.git/arch/x86/kernel/ldt.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/ldt.c 2008-02-01 19:30:01.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/ldt.c 2008-02-01 19:38:32.000000000 +0300
@@ -35,7 +35,8 @@ static int alloc_ldt(mm_context_t *pc, i
if (mincount <= pc->size)
return 0;
oldsize = pc->size;
- mincount = (mincount + 511) & (~511);
+ mincount = (mincount + (PAGE_SIZE / LDT_ENTRY_SIZE - 1)) &
+ (~(PAGE_SIZE / LDT_ENTRY_SIZE - 1));
if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
else