Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 506823f6 authored by Niklas Cassel's avatar Niklas Cassel Committed by Jesper Nilsson
Browse files

cris: intmem: fix pointer comparison compile warning



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: default avatarNiklas Cassel <nks@flawful.org>
Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
parent 9d74179a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);