Re: [PATCH] selftests/net: use MAP_FAILED instead of (void *)-1 in tcp_mmap
From: Joe Damato
Date: Wed Jul 22 2026 - 09:33:01 EST
On Wed, Jul 22, 2026 at 09:51:29AM +0800, longlong yan wrote:
> mmap() is documented to return MAP_FAILED on error, but tcp_mmap.c
> compares the return value against (void *)-1 and (unsigned char *)-1.
>
> Replace these with the standard MAP_FAILED macro for better readability
> and type safety.
>
> Signed-off-by: longlong yan <yanlonglong@xxxxxxxxxx>
> ---
> tools/testing/selftests/net/tcp_mmap.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
Looks right to me. Not sure if it needs to be set with "net-next" in the
subject line to make which tree this targets more explicit?
Either way:
Reviewed-by: Joe Damato <joe@xxxxxxx>