diff options
| author | Wander Lairson Costa <wander@redhat.com> | 2026-03-09 16:46:24 -0300 |
|---|---|---|
| committer | Tomas Glozar <tglozar@redhat.com> | 2026-03-11 15:29:50 +0100 |
| commit | 265905df83a4c1e78c1a912e1699d7c81d9540e6 (patch) | |
| tree | 078b03fe1c80bd08ae7ddb6d45f1ea71b2f94b1e /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 0f4bc9d67a643a6ea8b82faf724e44648b2c322d (diff) | |
rtla: Use str_has_prefix() for prefix checks
The code currently uses strncmp() combined with strlen() to check if a
string starts with a specific prefix. This pattern is verbose and prone
to errors if the length does not match the prefix string.
Replace this pattern with the str_has_prefix() helper function in both
trace.c and utils.c. This improves code readability and safety by
handling the prefix length calculation automatically.
In addition, remove the unused retval variable from
trace_event_save_hist() in trace.c to clean up the function and
silence potential compiler warnings.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260309195040.1019085-12-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
