linux-6.17/tools/testing/selftests/landlock/fs_test.c:5631: Test for pointer < 0 ?

From: David Binderman

Date: Tue Sep 30 2025 - 05:57:12 EST


Hello there,

Static analyser cppcheck says:

linux-6.17/tools/testing/selftests/landlock/fs_test.c:5631:23: style: A pointer can not be negative so it is either pointless or an error to check if it is. [pointerLessThanZero]

Source code is

    if (log_match_cursor < 0)
        return (long long)log_match_cursor;

but

char *log_match_cursor = log_match;

Suggest remove code.

Regards

David Binderman