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>
This commit is contained in:
Dima Kogan 2024-04-15 21:55:10 -07:00 committed by Arnaldo Carvalho de Melo
parent 03f2357017
commit a529bec023

View File

@ -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;