]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtla: Use strdup() to simplify code
authorWander Lairson Costa <wander@redhat.com>
Mon, 9 Mar 2026 19:46:15 +0000 (16:46 -0300)
committerTomas Glozar <tglozar@redhat.com>
Tue, 10 Mar 2026 09:32:37 +0000 (10:32 +0100)
commitb8f7f49a23897fc772373da513a1cb6d51e5958e
tree7f0e25716787f71f8e7ed33393367bb86836740f
parent009a8e681fb003f38dd57a640e11ed826740b5c1
rtla: Use strdup() to simplify code

The actions_add_trace_output() and actions_add_shell() functions were
using calloc() followed by strcpy() to allocate and copy a string.
This can be simplified by using strdup(), which allocates memory and
copies the string in a single step.

Replace the calloc() and strcpy() calls with strdup(), making the
code more concise and readable.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260309195040.1019085-3-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/src/actions.c