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 2AA8A1EABAB; Tue, 15 Oct 2024 11:45:22 +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=1728992723; cv=none; b=WaVrtGOFXAc9NclLIxY8TVX9p5w0jmIThG7qr+r5NQxtvEJIEllNWwpqCJBWNIxcikfYcA4d8Zl302l9dYNaWtUW4gFzJY2sQV817F5bXphU874j+ogZJ53B8T72EhT3Lr+tWb2pAmwNBja6TtmuBuUYmOuqlVHpx60rhnQTmNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728992723; c=relaxed/simple; bh=zS7o8EvgWEy+IVsvJkrOyRbfFnBn8xntLtpszejKUB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hkberY9eTcXhj+RgkDVyTGA7AN2FwhAyah0RJsqwK02aTpfAZsGgfS8FHT+vGcAe8QHZC5vOJCRHxCiocrvpEYpv3OmPQXp7gqrKB5/vvrgsm/6b8OQgHpI2ioSPdetlb9Z6RdVbzfwWrlpfFfQdLN5AIgav856HmsgQYPJ+SDk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Oc3eD3W8; 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="Oc3eD3W8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 465DBC4CEC6; Tue, 15 Oct 2024 11:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728992722; bh=zS7o8EvgWEy+IVsvJkrOyRbfFnBn8xntLtpszejKUB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oc3eD3W82LEPYiewWHYIYBNVF2VSzqB+OaCi5lHhPtb3fZLoKBpYZlY3GoUYoAHgy S1EhvLh3/VeBMjpZOvFJ0QMNuVuGbod5aIziL7yM5mEvqz93hP7uNWCz/w0ZliLsCq 1kaMCRlcCUv3eO18smxqZWd1SV1VcScAZqVFiBgw= 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 5.15 199/691] selftests/bpf: Fix error compiling test_lru_map.c Date: Tue, 15 Oct 2024 13:22:27 +0200 Message-ID: <20241015112448.254348405@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@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 5.15-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 7e9049fa3edfe..1359de58da6c5 100644 --- a/tools/testing/selftests/bpf/test_lru_map.c +++ b/tools/testing/selftests/bpf/test_lru_map.c @@ -137,7 +137,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