X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Falloc%2Falloc.c;h=e9aaf3ddea8c7c7727f6a65c5ccd4a516209307c;hb=8d8de08d9079f503256e1682dfa93bb22dcd4ad0;hp=643efedc85d1be3212e175051e3558def8021545;hpb=32ed68de4a723fac3d1144e2ce5679625462655e;p=ccan diff --git a/ccan/alloc/alloc.c b/ccan/alloc/alloc.c index 643efedc..e9aaf3dd 100644 --- a/ccan/alloc/alloc.c +++ b/ccan/alloc/alloc.c @@ -467,9 +467,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)) @@ -527,9 +525,8 @@ static bool huge_allocated(struct header *head, unsigned long offset) } /* They want something really big. Aim for contiguous pages (slow). */ -static COLD_ATTRIBUTE -void *huge_alloc(void *pool, unsigned long poolsize, - unsigned long size, unsigned long align) +static COLD void *huge_alloc(void *pool, unsigned long poolsize, + unsigned long size, unsigned long align) { struct header *head = pool; struct huge_alloc *ha; @@ -647,7 +644,7 @@ done: return (char *)pool + ha->off; } -static COLD_ATTRIBUTE void +static COLD void huge_free(struct header *head, unsigned long poolsize, void *free) { unsigned long i, off, pgnum, free_off = (char *)free - (char *)head; @@ -687,8 +684,7 @@ huge_free(struct header *head, unsigned long poolsize, void *free) alloc_free(head, poolsize, ha); } -static COLD_ATTRIBUTE unsigned long -huge_size(struct header *head, void *p) +static COLD unsigned long huge_size(struct header *head, void *p) { unsigned long i, off = (char *)p - (char *)head; struct huge_alloc *ha;