diff options
| author | Feng Yang <yangfeng@kylinos.cn> | 2025-03-14 11:10:13 +0800 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-03-18 16:55:30 -0700 |
| commit | 2b5b834cc3b97492901ed399ae0ceb737f6aaa06 (patch) | |
| tree | 7ad12719c0140edffd0ef73c937b1b043bf91d34 | |
| parent | 89aaeaf84231157288035b366cb6300c1c6cac64 (diff) | |
| download | linux-next-2b5b834cc3b97492901ed399ae0ceb737f6aaa06.tar.gz linux-next-2b5b834cc3b97492901ed399ae0ceb737f6aaa06.zip | |
perf kwork: Remove unreachable judgments
When s2[i] = '\0', if s1[i] != '\0', it will be judged by ret,
and if s1[i] = '\0', it will be judegd by !s1[i].
So in reality, s2 [i] will never make a judgment
Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250314031013.94480-1-yangfeng59949@163.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
| -rw-r--r-- | tools/perf/util/bpf_skel/kwork_trace.bpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/bpf_skel/kwork_trace.bpf.c b/tools/perf/util/bpf_skel/kwork_trace.bpf.c index cbd79bc4b330..9ce9c8dddc4b 100644 --- a/tools/perf/util/bpf_skel/kwork_trace.bpf.c +++ b/tools/perf/util/bpf_skel/kwork_trace.bpf.c @@ -80,7 +80,7 @@ static __always_inline int local_strncmp(const char *s1, for (i = 0; i < sz; i++) { ret = (unsigned char)s1[i] - (unsigned char)s2[i]; - if (ret || !s1[i] || !s2[i]) + if (ret || !s1[i]) break; } |
