From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD9A52EC572 for ; Wed, 1 Oct 2025 20:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759350200; cv=none; b=KQfTNKtdkGHCVItsRC/JolBVYsqdvdQXbMDE7ukuxGPUM1bysoZloi/43Z9l9vI1AU/u7v+HEZqcxTqnalTKyT696TjiESzpS1Q2giqTjBqQqlam1kkKE8Jh1IoVOLwkTFNC5eSZoEm4/qAnQu7lVuKgwU7ygfsK/Pm0owegh9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759350200; c=relaxed/simple; bh=sDgjk+ktzv45pAziz/W/rEGBe9ilvei4D3+TtKwEeiI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=icOrVWNc2CD6Ul0Idb5qe8B2KBz4CMXdTy/OrMpdEjQqaSk3HpjJU+7j5HbP7WkHtSFzOAMgzMsPvbNeGKXAs9w+ufaIKTKIP9cuuJIrUeoZwkyOEEyasvUqZ6juShfH8Q90kE1iLOXa1hxvU96tSzdU+Q22kQEhtquraxtL9t8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JHDsK5EQ; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JHDsK5EQ" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-7811a02316bso266382b3a.3 for ; Wed, 01 Oct 2025 13:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759350198; x=1759954998; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=sDgjk+ktzv45pAziz/W/rEGBe9ilvei4D3+TtKwEeiI=; b=JHDsK5EQA9BHU/k8SMTE81k07bDQYTd1EBvpaebK/gOi3/UEMH3D9fN2epj4eyHVpQ rHYPe5TeI91ZAyIi1fj06HInjed3SNKEOCECtaXs0Q1iGkMyZ1r8TVhpkOZZM70zo0Cr 29Bn8dNCBUhYaBm2LW1enKIZLgMHnIg2t6qsH0HZfpy9bzZ0zXtdaA0R68Uk4r+4Wwg/ n6UfTK8HJ9NEy2yIFsEsequfy4tUssjETMH4zVrG7vpptlO1fG95wyQovm9VFk8RJRIV 0rHJgBH4RhbA4QY7EJEesrF/QV1LEnZUdNb54v1G6ymeqMg78KcsZYqF4+Vxxjdxe6Ae 3BsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759350198; x=1759954998; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sDgjk+ktzv45pAziz/W/rEGBe9ilvei4D3+TtKwEeiI=; b=dl9bpud/lP8E7z/zVBzo+FYhyVM5hOm0PhLTUHmbcHFkEeCAhqpfCOsoG6Tl6zC0ZV trmnOu3Q383GGFviwcJsccuvSWlYCkV0DOSIIxUi7KQ7i/+e8vdTaL4Uujw6hq5OJqHA OK2/J25mq5k2JILrn4Bi2Ty0SYIGBmzMixj9Ix87HVxgya6EtZCEsXdjVU/SF94Easil s8D/oPCehozZpu/L7K32+BzqoyICNrHIhROeDEBVKkNks7/sqrHG7IH8IHtunEgrjDh6 2DG73B3FYW3RvwGIHQeFDCi+BTI6imeW/l1j2cd9JaA3KswiCvNB1XcQ9lS3remsRBAA edkw== X-Forwarded-Encrypted: i=1; AJvYcCVwGG3hV/7ERmIrrHc5921DBY+JhomS0uKBckTiL9G8QW993r9qVf+Dg7kDJS10qs4YhTkCtPc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzq0IfC7fuVCFZwfoPtHh13r3WYXiPm9jRBZoaz1OtCY0Jx3tYK Orp+mynsoFg0s5eqdL/y4drVanRGCmrROa/E5Bh4Kv42sDCx8hCCeAsX X-Gm-Gg: ASbGnctVD7Kb8AIjdkWrM/STOl20YfTK2Myp685WTL9Rsl/UCOY9AWIqT+QVxBcNZsu BYdv230Fhso9cEW/yIvJyH8yEBQ23Hlngez3xdhMNYWED6BRNCIouGH0UViuMyHtuxh2IbqINwF NSaGkioxuB0UavHpoKgLfNbyXIKfl/RosgZ8EKzw7zWfLH+no1fbqdV7NG9EB0jmVfGJEVEyPT6 42wa3UKWvy+W94AbIfJY4UJ08QaEpFFkSyVZEnwzYE9rJCzBLfZL5SFPVDkGPDsP9PSKIVtj0QN QCN8f65lgCKieP56C/A5aqn1Z3d5CmnmWCx81CEKAkpiznXx7/fuG/tpS306lBjGfGL7s74xvCh 1UuacjxBqPXe/9BSVtjoQMo0kGBqgM0n6Z+Z8tu6RQ96qk05ODi1wp4RsiOTWLuMKqVhUqa8= X-Google-Smtp-Source: AGHT+IEzLJ6xMI4TZdMZ4T+zFjMdd8zd+FBTLRL34IcHix6v7TwCxHpmo0m7KR94VG++00tXP6UsNg== X-Received: by 2002:a05:6a00:8d3:b0:776:138a:ec97 with SMTP id d2e1a72fcca58-78af4176ab3mr5284861b3a.28.1759350197746; Wed, 01 Oct 2025 13:23:17 -0700 (PDT) Received: from ?IPv6:2a03:83e0:115c:1:1ed4:e17:bedc:abbb? ([2620:10d:c090:500::6:420a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-78b01f9dae7sm531831b3a.9.2025.10.01.13.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Oct 2025 13:23:17 -0700 (PDT) Message-ID: Subject: Re: [PATCH] selftests/bpf: Add -Wsign-compare C compilation flag From: Eduard Zingerman To: Mehdi Ben Hadj Khelifa , andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, shuah@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, davem@davemloft.net, kuba@kernel.org, hawk@kernel.org, linux@jordanrome.com, ameryhung@gmail.com, toke@redhat.com, houtao1@huawei.com, emil@etsalapatis.com, yatsenko@meta.com, isolodrai@meta.com, a.s.protopopov@gmail.com, dxu@dxuuu.xyz, memxor@gmail.com, vmalik@redhat.com, bigeasy@linutronix.de, tj@kernel.org, gregkh@linuxfoundation.org, paul@paul-moore.com, bboscaccy@linux.microsoft.com, James.Bottomley@HansenPartnership.com, mrpre@163.com, jakub@cloudflare.com Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org, david.hunter.linux@gmail.com Date: Wed, 01 Oct 2025 13:23:13 -0700 In-Reply-To: <20250924162408.815137-1-mehdi.benhadjkhelifa@gmail.com> References: <20250924162408.815137-1-mehdi.benhadjkhelifa@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2025-09-24 at 17:23 +0100, Mehdi Ben Hadj Khelifa wrote: > -Change all the source files and the corresponding headers=20 > to having matching sign comparisons. >=20 > Signed-off-by: Mehdi Ben Hadj Khelifa > --- > As suggested by the TODO, -Wsign-compare was added to the C compilation > flags for the selftests/bpf/Makefile and all corresponding files in > selftests and a single file under tools/lib/bpf/usdt.bpf.h have been > carefully changed to account for correct sign comparisons either by > explicit casting or changing the variable type.Only local variables > and variables which are in limited scope have been changed in cases > where it doesn't break the code.Other struct variables or global ones=20 > have left untouched to avoid other conflicts and opted to explicit=20 > casting in this case.This change will help avoid implicit type=20 > conversions and have predictable behavior. >=20 > I have already compiled all bpf tests with no errors as well as the > kernel and have ran all the selftests with no obvious side effects. > I would like to know if it's more convinient to have all changes as > a single patch like here or if it needs to be divided in some way=20 > and sent as a patch series. >=20 > Best Regards, > Mehdi Ben Hadj Khelifa > --- I don't understand why this change is necessary. Have you found any bugs while doing this conversion? [...]