aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 683a30572cc5..54f1ea808db5 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -387,10 +387,10 @@ out_delete_desc:
387 return NULL; 387 return NULL;
388} 388}
389 389
390static char *ends_with(char *str, const char *suffix) 390static const char *ends_with(const char *str, const char *suffix)
391{ 391{
392 size_t suffix_len = strlen(suffix); 392 size_t suffix_len = strlen(suffix);
393 char *p = str; 393 const char *p = str;
394 394
395 if (strlen(str) > suffix_len) { 395 if (strlen(str) > suffix_len) {
396 p = str + strlen(str) - suffix_len; 396 p = str + strlen(str) - suffix_len;
@@ -482,7 +482,7 @@ static int list_available_scripts(const struct option *opt __used,
482 482
483 for_each_script(lang_path, lang_dir, script_dirent, script_next) { 483 for_each_script(lang_path, lang_dir, script_dirent, script_next) {
484 script_root = strdup(script_dirent.d_name); 484 script_root = strdup(script_dirent.d_name);
485 str = ends_with(script_root, REPORT_SUFFIX); 485 str = (char *)ends_with(script_root, REPORT_SUFFIX);
486 if (str) { 486 if (str) {
487 *str = '\0'; 487 *str = '\0';
488 desc = script_desc__findnew(script_root); 488 desc = script_desc__findnew(script_root);
@@ -530,7 +530,7 @@ static char *get_script_path(const char *script_root, const char *suffix)
530 530
531 for_each_script(lang_path, lang_dir, script_dirent, script_next) { 531 for_each_script(lang_path, lang_dir, script_dirent, script_next) {
532 __script_root = strdup(script_dirent.d_name); 532 __script_root = strdup(script_dirent.d_name);
533 str = ends_with(__script_root, suffix); 533 str = (char *)ends_with(__script_root, suffix);
534 if (str) { 534 if (str) {
535 *str = '\0'; 535 *str = '\0';
536 if (strcmp(__script_root, script_root)) 536 if (strcmp(__script_root, script_root))
@@ -550,7 +550,7 @@ static char *get_script_path(const char *script_root, const char *suffix)
550 550
551static bool is_top_script(const char *script_path) 551static bool is_top_script(const char *script_path)
552{ 552{
553 return ends_with((char *)script_path, "top") == NULL ? false : true; 553 return ends_with(script_path, "top") == NULL ? false : true;
554} 554}
555 555
556static int has_required_arg(char *script_path) 556static int has_required_arg(char *script_path)