]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bpf: Use arg_is_fp() in has_fp_args()
authorYonghong Song <yonghong.song@linux.dev>
Wed, 13 May 2026 04:50:35 +0000 (21:50 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 13 May 2026 16:27:31 +0000 (09:27 -0700)
Replace "frame != ARG_NONE" with arg_is_fp() in has_fp_args().
The function's purpose is to check whether any argument is derived
from a frame pointer, which is exactly what arg_is_fp() tests
(frame >= 0 || frame == ARG_IMPRECISE). Using the dedicated
predicate is clearer and more consistent with the rest of the file.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260513045035.2388671-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/liveness.c

index c81337dfbfc79207e4aa07798e0878ba15523177..13dc5ae44d2b56a8e91ab43eabf0a2ffd0aa29be 100644 (file)
@@ -1689,7 +1689,7 @@ err_free:
 static bool has_fp_args(struct arg_track *args)
 {
        for (int r = BPF_REG_1; r <= BPF_REG_5; r++)
-               if (args[r].frame != ARG_NONE)
+               if (arg_is_fp(&args[r]))
                        return true;
        return false;
 }