X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Falloc%2Falloc.c;h=4b3c03cea47c3ea1910460105b9939fcb545d00e;hp=64475078c0a6811f88b5dcf9861492a117a2ff41;hb=414da16fc2996a74f19f47ab7379ca61a723b425;hpb=1c005e1223d2f8f664ce4b3be6cd7eb4dd449844 diff --git a/ccan/alloc/alloc.c b/ccan/alloc/alloc.c index 64475078..4b3c03ce 100644 --- a/ccan/alloc/alloc.c +++ b/ccan/alloc/alloc.c @@ -422,7 +422,8 @@ static void del_large_from_small_free_list(struct header *head, for (i = 0; i < SMALL_PAGES_PER_LARGE_PAGE; i++) { del_from_list(head, &head->small_free_list, - (void *)ph + (i << sp_bits), + (struct page_header *)((char *)ph + + (i << sp_bits)), sp_bits); } } @@ -467,9 +468,7 @@ static void recombine_small_pages(struct header *head, unsigned long poolsize, static u16 get_large_page(struct header *head, unsigned long poolsize, unsigned int sp_bits) { - unsigned int lp_bits, page; - - lp_bits = sp_bits + BITS_FROM_SMALL_TO_LARGE_PAGE; + unsigned int page; page = pop_from_list(head, &head->large_free_list, sp_bits); if (likely(page))