diff options
author | Dima Kogan <dima@secretsauce.net> | 2024-04-16 07:55:10 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-04-19 04:22:51 +0300 |
commit | a529bec023d7d14d9fb7d5b456921630e63edc6b (patch) | |
tree | 4e5a41d8b686df80fcf93423cfe395a0684418f4 /tools/perf | |
parent | 03f2357017c37d68e73d7d8d77abfcb72e12bc86 (diff) | |
download | linux-a529bec023d7d14d9fb7d5b456921630e63edc6b.tar.xz |
perf probe-event: Un-hardcode sizeof(buf)
In several places we had
char buf[64];
...
snprintf(buf, 64, ...);
This patch changes it to
char buf[64];
...
snprintf(buf, sizeof(buf), ...);
so the "64" is only stated once.
Signed-off-by: Dima Kogan <dima@secretsauce.net>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20240416045533.162692-2-dima@secretsauce.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/probe-event.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 5c12459e9765..c1dbad8a83dc 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -236,7 +236,7 @@ static int convert_exec_to_group(const char *exec, char **result) } } - ret = e_snprintf(buf, 64, "%s_%s", PERFPROBE_GROUP, ptr1); + ret = e_snprintf(buf, sizeof(buf), "%s_%s", PERFPROBE_GROUP, ptr1); if (ret < 0) goto out; @@ -2867,7 +2867,7 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev, group = PERFPROBE_GROUP; /* Get an unused new event name */ - ret = get_new_event_name(buf, 64, event, namelist, + ret = get_new_event_name(buf, sizeof(buf), event, namelist, tev->point.retprobe, allow_suffix); if (ret < 0) return ret; |