]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf: Fix libjvmti.c sign compare error
authorYuzhuo Jing <yuzhuo@google.com>
Wed, 4 Jun 2025 17:36:32 +0000 (10:36 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 10 Jun 2025 05:12:08 +0000 (22:12 -0700)
Fix the compile errors when compiling with -Werror=sign-compare.

This is a follow-up patch to a previous patch series for a separate
Link: https://lore.kernel.org/lkml/aC9lXhPFcs5fkHWH@x1/
Signed-off-by: Yuzhuo Jing <yuzhuo@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250604173632.2362759-1-yuzhuo@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/jvmti/libjvmti.c

index fcca275e5bf9c24bc6d8e952fd3331301d5d2e1b..82514e6532b8c3afdea1aa4fe961a589cd9c60c3 100644 (file)
@@ -141,11 +141,11 @@ copy_class_filename(const char * class_sign, const char * file_name, char * resu
        * Assume path name is class hierarchy, this is a common practice with Java programs
        */
        if (*class_sign == 'L') {
-               int j, i = 0;
+               size_t j, i = 0;
                char *p = strrchr(class_sign, '/');
                if (p) {
                        /* drop the 'L' prefix and copy up to the final '/' */
-                       for (i = 0; i < (p - class_sign); i++)
+                       for (i = 0; i < (size_t)(p - class_sign); i++)
                                result[i] = class_sign[i+1];
                }
                /*