[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <581decf0-d360-4da8-a247-3b207d5ca21b@gmail.com>
Date: Wed, 1 Oct 2025 21:28:48 +0100
From: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@...il.com>
To: Eduard Zingerman <eddyz87@...il.com>, andrii@...nel.org, ast@...nel.org,
daniel@...earbox.net, martin.lau@...ux.dev, song@...nel.org,
yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, shuah@...nel.org,
matttbe@...nel.org, martineau@...nel.org, geliang@...nel.org,
davem@...emloft.net, kuba@...nel.org, hawk@...nel.org, linux@...danrome.com,
ameryhung@...il.com, toke@...hat.com, houtao1@...wei.com,
emil@...alapatis.com, yatsenko@...a.com, isolodrai@...a.com,
a.s.protopopov@...il.com, dxu@...uu.xyz, memxor@...il.com,
vmalik@...hat.com, bigeasy@...utronix.de, tj@...nel.org,
gregkh@...uxfoundation.org, paul@...l-moore.com,
bboscaccy@...ux.microsoft.com, James.Bottomley@...senPartnership.com,
mrpre@....com, jakub@...udflare.com
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
mptcp@...ts.linux.dev, linux-kernel-mentees@...ts.linuxfoundation.org,
skhan@...uxfoundation.org, david.hunter.linux@...il.com
Subject: Re: [PATCH] selftests/bpf: Add -Wsign-compare C compilation flag
On 10/1/25 9:23 PM, Eduard Zingerman wrote:
> On Wed, 2025-09-24 at 17:23 +0100, Mehdi Ben Hadj Khelifa wrote:
>> -Change all the source files and the corresponding headers
>> to having matching sign comparisons.
>>
>> Signed-off-by: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@...il.com>
>> ---
>> 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
>> have left untouched to avoid other conflicts and opted to explicit
>> casting in this case.This change will help avoid implicit type
>> conversions and have predictable behavior.
>>
>> 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
>> and sent as a patch series.
>>
>> Best Regards,
>> Mehdi Ben Hadj Khelifa
>> ---
>
> I don't understand why this change is necessary.
> Have you found any bugs while doing this conversion?
>
> [...]
Hi Eduard,
No I have not. It's more of a future proof patch / improvement rather
than a fixing patch as i mentioned in this email[1] with more detail.
Regards,
Mehdi
[1]:https://lore.kernel.org/all/e3a0d8ff-d03d-4854-bf04-8ff8265b0257@gmail.com/
Powered by blists - more mailing lists