On Tue, 2025-06-24 at 19:36 +0000, Anton Protopopov wrote: > There are places in code which can be simplified by using the > btf_type_is_regular_int() helper (slightly patched to add an > additional, optional, argument to check the exact size). So > patch the helper, export it, and simplify code in a few files. > (Suggested by Eduard in a bit different form in [1].) > > [1] https://lore.kernel.org/bpf/7edb47e73baa46705119a23c6bf4af26517a640f.camel@xxxxxxxxx/ > > Suggested-by: Eduard Zingerman <eddyz87@xxxxxxxxx> > Signed-off-by: Anton Protopopov <a.s.protopopov@xxxxxxxxx> > --- I think such cleanup makes sense. Imo, the patch would be a bit simpler if: - original interface of the btf_type_int_is_regular() is preserved, thus avoiding most of the changes in the btf.c; - helpers btf_is_i32 and btf_is_i64 are introduced for external usage. E.g. like here: https://github.com/kernel-patches/bpf/commit/d3c003f0a83cb66700f6a6e9b750d8e425b53cf5 (I use btf_is_u{32,64} there, but it should be i{32,64}). Nit: the subject is a bit too generic. [...]