return (x + align - 1) & ~(align - 1);
}
-static void *from_off(struct header *head, unsigned long off)
+static struct page_header *from_off(struct header *head, unsigned long off)
{
- return (char *)head + off;
+ return (struct page_header *)((char *)head + off);
}
static unsigned long to_off(struct header *head, void *p)
static size_t used_size(unsigned int num_elements)
{
- return (num_elements + BITS_PER_LONG-1) / BITS_PER_LONG;
+ return align_up(num_elements, BITS_PER_LONG) / CHAR_BIT;
}
/*