[i-g-t 1/4] runner/settings: Update absolute_path function to accept const char* parameter

Naladala Ramanaidu ramanaidu.naladala at intel.com
Wed Aug 7 09:11:59 UTC 2024


Modified the absolute_path function in settings.c to take a
const char* parameter instead of char*. Updated the corresponding
declaration in settings.h.This change ensures that the input path
is not modified within the function, improving code safety and clarity.

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
 runner/settings.c | 2 +-
 runner/settings.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/runner/settings.c b/runner/settings.c
index 42d8137f1..08a78ad02 100644
--- a/runner/settings.c
+++ b/runner/settings.c
@@ -549,7 +549,7 @@ static char *_basename(const char *path)
 	return tmpname;
 }
 
-char *absolute_path(char *path)
+char *absolute_path(const char *path)
 {
 	char *result = NULL;
 	char *base, *dir;
diff --git a/runner/settings.h b/runner/settings.h
index 819c34602..16b45147b 100644
--- a/runner/settings.h
+++ b/runner/settings.h
@@ -133,7 +133,7 @@ bool parse_options(int argc, char **argv,
 bool validate_settings(struct settings *settings);
 
 /* TODO: Better place for this */
-char *absolute_path(char *path);
+char *absolute_path(const char *path);
 
 /**
  * serialize_settings:
-- 
2.43.0



More information about the Intel-gfx-trybot mailing list