[PATCH i-g-t v2 2/5] runner/settings: Constify absolute_path parameter

Naladala Ramanaidu ramanaidu.naladala at intel.com
Tue Jan 7 20:06:11 UTC 2025


Modified absolute_path to use const char* for input, updating the
corresponding declaration. This ensures the input path remains
unmodified, enhancing code safety and clarity.

v2: Update commit subject.  (kmail)

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 92fd42ea6..bea0c3059 100644
--- a/runner/settings.c
+++ b/runner/settings.c
@@ -567,7 +567,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 f69f09778..7e6cd11e2 100644
--- a/runner/settings.h
+++ b/runner/settings.h
@@ -136,7 +136,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 igt-dev mailing list