Re: [PATCH v2 04/47] perf bench: Silence -Wshorten-64-to-32 warnings
From: Dirk Gouders
Date: Wed Apr 30 2025 - 16:27:17 EST
Hi Ian,
considering so many eyes looking at this, I am probably wrong.
So, this is only a "gauge reply" to see if it's worth I really read
through all the commits ;-)
Ian Rogers <irogers@xxxxxxxxxx> writes:
[SNIP]
> diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
> index 70139036d68f..b847213fd616 100644
> --- a/tools/perf/bench/sched-pipe.c
> +++ b/tools/perf/bench/sched-pipe.c
> @@ -102,7 +102,8 @@ static const char * const bench_sched_pipe_usage[] = {
> static int enter_cgroup(int nr)
> {
> char buf[32];
> - int fd, len, ret;
> + int fd;
> + ssize_t ret, len;
> int saved_errno;
> struct cgroup *cgrp;
> pid_t pid;
> @@ -118,7 +119,7 @@ static int enter_cgroup(int nr)
> cgrp = cgrps[nr];
>
> if (threaded)
> - pid = syscall(__NR_gettid);
> + pid = (pid_t)syscall(__NR_gettid);
> else
> pid = getpid();
>
> @@ -172,23 +173,25 @@ static void exit_cgroup(int nr)
>
> static inline int read_pipe(struct thread_data *td)
> {
> - int ret, m;
> + ssize_t ret;
> + int m;
> retry:
> if (nonblocking) {
> ret = epoll_wait(td->epoll_fd, &td->epoll_ev, 1, -1);
The epoll_wait(), I know of, returns an int and not ssize_t.
That shouldn't show up, because it doesn't cause real problems...
Best regards,
Dirk