Skip to content

Commit

Permalink
cris: intmem: fix pointer comparison compile warning
Browse files Browse the repository at this point in the history
The code previously depended on list_head being defined
as the first item in struct intmem_allocation.

arch/cris/arch-v32/mm/intmem.c: In function ‘crisv32_intmem_free’:
arch/cris/arch-v32/mm/intmem.c:116:14: warning: comparison of distinct pointer types lacks a cast
    if ((prev != &intmem_allocations) &&
              ^
arch/cris/arch-v32/mm/intmem.c:123:14: warning: comparison of distinct pointer types lacks a cast
    if ((next != &intmem_allocations) &&
              ^

Signed-off-by: Niklas Cassel <[email protected]>
Signed-off-by: Jesper Nilsson <[email protected]>
  • Loading branch information
Niklas Cassel authored and Jesper Nilsson committed Sep 22, 2016
1 parent 9d74179 commit 506823f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/cris/arch-v32/mm/intmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ void crisv32_intmem_free(void* addr)

allocation->status = STATUS_FREE;
/* Join with prev and/or next if also free */
if ((prev != &intmem_allocations) &&
if ((&prev->entry != &intmem_allocations) &&
(prev->status == STATUS_FREE)) {
prev->size += allocation->size;
list_del(&allocation->entry);
kfree(allocation);
allocation = prev;
}
if ((next != &intmem_allocations) &&
if ((&next->entry != &intmem_allocations) &&
(next->status == STATUS_FREE)) {
allocation->size += next->size;
list_del(&next->entry);
Expand Down

0 comments on commit 506823f

Please sign in to comment.