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

From: Cyrill Gorcunov
Date: Fri Feb 01 2008 - 12:14:52 EST


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@xxxxxxxxx>

---

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/