alloc: avoid arithmetic on void pointers.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:50:19 +0000 (12:20 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:50:19 +0000 (12:20 +1030)
ccan/alloc/alloc.c

index e9aaf3ddea8c7c7727f6a65c5ccd4a516209307c..4b3c03cea47c3ea1910460105b9939fcb545d00e 100644 (file)
@@ -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);
        }
 }