Re: [PATCH v2] selftest/mm: fix pointer comparison in mremap_test

From: David Hildenbrand (Red Hat)
Date: Mon Nov 10 2025 - 04:10:59 EST


On 08.11.25 17:18, Ankit Khushwaha wrote:
Pointer arthemitic with 'void * addr' and 'ulong dest_alignment'
triggers following warning:

mremap_test.c:1035:31: warning: pointer comparison always evaluates to
false [-Wtautological-compare]
1035 | if (addr + c.dest_alignment < addr) {
| ^

this warning is raised from clang version 20.1.8 (Fedora 20.1.8-4.fc42).

use 'void *tmp_addr' to do the pointer arthemitic.

Signed-off-by: Ankit Khushwaha <ankitkhushwaha.linux@xxxxxxxxx>
---

Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>

--
Cheers

David