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 7814F1C07C4; Tue, 15 Oct 2024 13:01:34 +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=1728997294; cv=none; b=HDS/Jcug8LmpnU5ObP5UTsEqzbA52lqkm/Sr0zUaJxjK2UaCpeske984SBkuoFSZCcBpROOcWqDqDWwdHf3hmrwUtkc7J54nhmBZIBbOcV/fi2wCeRo+Y5taUbRDjb2CR2G3d/GaXJngslVERsQEzJbMX/wz0g2V/MBnGCyIMvo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728997294; c=relaxed/simple; bh=HPzOs8EEzVU91e/fOZgaYVje4TZh8GAx09IFqB4zJVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J+Rjy8WW3l5KZqUNaRZQDtDje17eDJaRE/2hgrdO98A49UIE/3o2ZdXjRLUUmiL2K2E0D7QUDK4l7eV9Ya7pVMhomnUUtbqwWaaen4kCvX5h9MzD0e6zYwjt8blPTTba5A8TUx8QFMe0v8Yh+wT7F9UE/o2kC1KBHK3KKmO54Dc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lr4DcxAf; 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="lr4DcxAf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7742C4CEC6; Tue, 15 Oct 2024 13:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728997294; bh=HPzOs8EEzVU91e/fOZgaYVje4TZh8GAx09IFqB4zJVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lr4DcxAfoaH+rCxzKc9QbZoioIMhPD48wI7CfecWHu8QCxJp+QF+NqlRwRmj4nzjp CbZgZHQxeSTa7Bvkx9zEtU1+acr62kTE1hN4xHTE5Hh+orlb8jlhGoJDYyUBbav+yS 0zzBlgdI1pOkVzta/V8FlnjIFTwbOVoeYJX7toUQ= 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.10 142/518] selftests/bpf: Fix error compiling test_lru_map.c Date: Tue, 15 Oct 2024 14:40:46 +0200 Message-ID: <20241015123922.478161491@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015123916.821186887@linuxfoundation.org> References: <20241015123916.821186887@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 6a5349f9eb148..7748d28e8b97a 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