[PATCH i-g-t v7 11/48] lib/igt_debugfs: Add const when make sense

Louis Chauvet
2026-02-23T12:09:01Z

Const qualifier avoid unwanted modifications. Add const at place where
it make sense.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
lib/igt_debugfs.c | 6 +++---
lib/igt_debugfs.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 6072d7d68025..b9f1e425c822 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -270,7 +270,7 @@ int igt_debugfs_tile_dir(int device, uint8_t tile)
* Returns:
* The directory fd, or -1 on failure.
*/
-int igt_debugfs_connector_dir(int device, char *conn_name, int mode)
+int igt_debugfs_connector_dir(int device, const char *conn_name, int mode)
{
int dir, ret;

@@ -790,7 +790,7 @@ void __igt_debugfs_dump(int device, const char *filename, int level)
*
* Returns: 0 on success, -1 on failure.
*/
-int igt_debugfs_read_connector_file(int drm_fd, char *conn_name,
+int igt_debugfs_read_connector_file(int drm_fd, const char *conn_name,
const char *filename, char *buf,
size_t buf_size)
{
@@ -820,7 +820,7 @@ int igt_debugfs_read_connector_file(int drm_fd, char *conn_name,
*
* Returns: 0 on success, -1 on failure.
*/
-int igt_debugfs_write_connector_file(int drm_fd, char *conn_name,
+int igt_debugfs_write_connector_file(int drm_fd, const char *conn_name,
const char *filename, const char *data,
size_t data_size)
{
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 49fbadd2a74c..08f9152fec95 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -34,7 +34,7 @@ const char *igt_debugfs_mount(void);
char *igt_debugfs_path(int device, char *path, int pathlen);

int igt_debugfs_dir(int device);
-int igt_debugfs_connector_dir(int device, char *conn_name, int mode);
+int igt_debugfs_connector_dir(int device, const char *conn_name, int mode);
int igt_debugfs_crtc_dir(int device, int crtc_index, int mode);

int igt_debugfs_open(int fd, const char *filename, int mode);
@@ -177,10 +177,10 @@ int igt_get_stable_obj_count(int driver);
void __igt_debugfs_dump(int device, const char *filename, int level);
#define igt_debugfs_dump(d, f) __igt_debugfs_dump(d, f, IGT_LOG_DEBUG)

-int igt_debugfs_read_connector_file(int drm_fd, char *conn_name,
+int igt_debugfs_read_connector_file(int drm_fd, const char *conn_name,
const char *filename, char *buf,
size_t buf_size);
-int igt_debugfs_write_connector_file(int drm_fd, char *conn_name,
+int igt_debugfs_write_connector_file(int drm_fd, const char *conn_name,
const char *filename, const char *data,
size_t data_size);
bool connector_attr_set_debugfs(int drm_fd,

--
2.52.0