Patch "selftests/futex: don't pass a const char* to asprintf(3)" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/futex: don't pass a const char* to asprintf(3)

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-futex-don-t-pass-a-const-char-to-asprintf-.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0f389fb2cc7a6ad2572fde180f7853d08ff314a0
Author: John Hubbard <jhubbard@xxxxxxxxxx>
Date:   Fri May 31 13:07:54 2024 -0700

    selftests/futex: don't pass a const char* to asprintf(3)
    
    [ Upstream commit 4bf15b1c657d22d1d70173e43264e4606dfe75ff ]
    
    When building with clang, via:
    
        make LLVM=1 -C tools/testing/selftests
    
    ...clang issues this warning:
    
    futex_requeue_pi.c:403:17: warning: passing 'const char **' to parameter
    of type 'char **' discards qualifiers in nested pointer types
    [-Wincompatible-pointer-types-discards-qualifiers]
    
    This warning fires because test_name is passed into asprintf(3), which
    then changes it.
    
    Fix this by simply removing the const qualifier. This is a local
    automatic variable in a very short function, so there is not much need
    to use the compiler to enforce const-ness at this scope.
    
    [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@xxxxxxxxxxxxxxx/
    
    Fixes: f17d8a87ecb5 ("selftests: fuxex: Report a unique test name per run of futex_requeue_pi")
    Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>
    Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
index 7f3ca5c78df12..215c6cb539b4a 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
@@ -360,7 +360,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns)
 
 int main(int argc, char *argv[])
 {
-	const char *test_name;
+	char *test_name;
 	int c, ret;
 
 	while ((c = getopt(argc, argv, "bchlot:v:")) != -1) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux