Re: [PATCH bpf-next v2] bpftool: avoid sign extension in unsigned enum JSON dumps

From: patchwork-bot+netdevbpf

Date: Fri Oct 30 2026 - 18:40:38 EST


Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@xxxxxxxxxx>:

On Fri, 30 Oct 2026 19:53:43 +0000 you wrote:
> The BTF enum value is stored in a signed 32-bit field even when the
> enum is unsigned. Passing it directly to jsonw_uint_field(), which
> takes a uint64_t, sign-extends values with bit 31 set. For example,
> 0xffffffffU is printed as 18446744073709551615 instead of 4294967295
> by bpftool -j btf dump.
>
> Cast the value to __u32 before widening it, matching the conversion
> already used for plain-text output.
>
> [...]

Here is the summary with links:
- [bpf-next,v2] bpftool: avoid sign extension in unsigned enum JSON dumps
https://git.kernel.org/bpf/bpf-next/c/eaae576c34d7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html