page_alloc strange mask += mask

Andrea Arcangeli (arcangeli@mbox.queen.it)
Mon, 3 Aug 1998 16:38:09 +0200 (CEST)


Continuing my trail in the mm internals I didn' t understood this point
(and a lot of other things of course ;-). Using mask += mask some low bits
got lost by the mask. Was that intentional?

===================================================================
RCS file: linux/mm/page_alloc.c,v
retrieving revision 1.1
diff -u -r1.1 linux/mm/page_alloc.c
--- linux/mm/page_alloc.c 1998/08/03 14:08:25 1.1
+++ linux/mm/page_alloc.c 1998/08/03 14:20:22
@@ -343,7 +343,7 @@
for (i = 0 ; i < NR_MEM_LISTS ; i++) {
unsigned long bitmap_size;
init_mem_queue(free_area+i);
- mask += mask;
+ mask = mask << 1 | 1;
end_mem = (end_mem + ~mask) & mask;
bitmap_size = (end_mem - PAGE_OFFSET) >> (PAGE_SHIFT + i);
bitmap_size = (bitmap_size + 7) >> 3;

Andrea[s] Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html