Patch "selftests/bpf: Fix error compiling test_lru_map.c" has been added to the 4.19-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/bpf: Fix error compiling test_lru_map.c

to the 4.19-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-bpf-fix-error-compiling-test_lru_map.c.patch
and it can be found in the queue-4.19 subdirectory.

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



commit a40401dbe10a2c827bf47f49c2e62808eae6cb91
Author: Tony Ambardar <tony.ambardar@xxxxxxxxx>
Date:   Mon Jul 29 02:24:19 2024 -0700

    selftests/bpf: Fix error compiling test_lru_map.c
    
    [ Upstream commit cacf2a5a78cd1f5f616eae043ebc6f024104b721 ]
    
    Although the post-increment in macro 'CPU_SET(next++, &cpuset)' seems safe,
    the sequencing can raise compile errors, so move the increment outside the
    macro. This avoids an error seen using gcc 12.3.0 for mips64el/musl-libc:
    
      In file included from test_lru_map.c:11:
      test_lru_map.c: In function 'sched_next_online':
      test_lru_map.c:129:29: error: operation on 'next' may be undefined [-Werror=sequence-point]
        129 |                 CPU_SET(next++, &cpuset);
            |                             ^
      cc1: all warnings being treated as errors
    
    Fixes: 3fbfadce6012 ("bpf: Fix test_lru_sanity5() in test_lru_map.c")
    Signed-off-by: Tony Ambardar <tony.ambardar@xxxxxxxxx>
    Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/22993dfb11ccf27925a626b32672fd3324cb76c4.1722244708.git.tony.ambardar@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/bpf/test_lru_map.c b/tools/testing/selftests/bpf/test_lru_map.c
index 781c7de343be0..a9ed4b58c0879 100644
--- a/tools/testing/selftests/bpf/test_lru_map.c
+++ b/tools/testing/selftests/bpf/test_lru_map.c
@@ -76,7 +76,8 @@ static int sched_next_online(int pid, int *next_to_try)
 
 	while (next < nr_cpus) {
 		CPU_ZERO(&cpuset);
-		CPU_SET(next++, &cpuset);
+		CPU_SET(next, &cpuset);
+		next++;
 		if (!sched_setaffinity(pid, sizeof(cpuset), &cpuset)) {
 			ret = 0;
 			break;




[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