From: Jiapeng Chong Date: Fri, 15 Nov 2024 09:15:27 +0000 (+0800) Subject: perf tests: Fix an incorrect type in append_script() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9ba3462c1ce5f1596c8f065540628cec7bdad005;p=users%2Fjedix%2Flinux-maple.git perf tests: Fix an incorrect type in append_script() The return value from the call to readlink() is ssize_t. However, the return value is being assigned to an size_t variable 'len', so making 'len' an ssize_t. ./tools/perf/tests/tests-scripts.c:182:5-8: WARNING: Unsigned expression compared with zero: len < 0. Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11909 Reported-by: Abaci Robot Reviewed-by: Ian Rogers Signed-off-by: Jiapeng Chong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20241115091527.128923-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/tests-scripts.c b/tools/perf/tests/tests-scripts.c index cf3ae0c1d8717..1d5759d081417 100644 --- a/tools/perf/tests/tests-scripts.c +++ b/tools/perf/tests/tests-scripts.c @@ -174,7 +174,7 @@ static void append_script(int dir_fd, const char *name, char *desc, char filename[PATH_MAX], link[128]; struct test_suite *test_suite, **result_tmp; struct test_case *tests; - size_t len; + ssize_t len; char *exclusive; snprintf(link, sizeof(link), "/proc/%d/fd/%d", getpid(), dir_fd);