From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 623A01D095B; Wed, 2 Oct 2024 13:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727875972; cv=none; b=IMEaeQWJYv+RU8fk812ILCnXxma9WnJ2oBo9b9deqxxj8WYf2C4465EC4jfl5TkVLyNJwVOdmqSpcAUpxSmsUSltaIfeL8785173GTXWvKDi6PzNtm/2j+ldFBcF1XtEZM7PTrlkZ42jnT9lLVSXwcDtqLKff6JYxTs0zt2JYU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727875972; c=relaxed/simple; bh=EntWRBAGUSrnP1LIJ1yooZ1ouC/qLfNr9Xjj+f6ImTo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZCKoN5W6gRpHnoOLXQ1mYH+xMqTXNEKNdfZsTHnYKdY55/b6GxneARVXM4p8O/o5S60w0MpGJAM3AHOHhpqp7DQIBd//idh/XXYd84R+4J6k/KO1X2QLzsLD0CziaFPPY932NFxhjph6oclFMFAgtwidYp/PKnKyTi6wKS8dfMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Yq28fQsi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Yq28fQsi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5B0C4CEC5; Wed, 2 Oct 2024 13:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727875972; bh=EntWRBAGUSrnP1LIJ1yooZ1ouC/qLfNr9Xjj+f6ImTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yq28fQsi82TQ5fUT2MCGS1kBSXIcLpLn4M8ww26I77sPZaZDi5PdT6+GdTVrGemNb ngSLPfsPpSt+nd64RDEs5ICdsw1VM48sYJbkM8frC/BQ4GvZXmJyfd4c/M1Tbxc+Y8 uJIXT3qb7DsUUpL77zN/6Ox+Qy2HGv2F0FVV5yAg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tony Ambardar , Andrii Nakryiko , Sasha Levin Subject: [PATCH 6.11 283/695] selftests/bpf: Fix error compiling test_lru_map.c Date: Wed, 2 Oct 2024 14:54:41 +0200 Message-ID: <20241002125833.741896368@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125822.467776898@linuxfoundation.org> References: <20241002125822.467776898@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Ambardar [ 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 Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/22993dfb11ccf27925a626b32672fd3324cb76c4.1722244708.git.tony.ambardar@gmail.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_lru_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_lru_map.c b/tools/testing/selftests/bpf/test_lru_map.c index 4d0650cfb5cd8..fda7589c50236 100644 --- a/tools/testing/selftests/bpf/test_lru_map.c +++ b/tools/testing/selftests/bpf/test_lru_map.c @@ -126,7 +126,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; -- 2.43.0