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

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

Const qualifier helps to avoid unwanted modification of a pointer.
To help avoiding those errors, modify the function signature to
use const.

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_amd.c | 2 +-
lib/igt_amd.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 3ddb5f40374e..081bad411355 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -831,7 +831,7 @@ int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
* values of "Current", "Verified", "Reported", and "Preferred", respectively.
*/
void igt_amd_read_link_settings(
- int drm_fd, char *connector_name, int *lane_count, int *link_rate, int *link_spread)
+ int drm_fd, const char *connector_name, int *lane_count, int *link_rate, int *link_spread)
{
int fd, ret;
char buf[101];
diff --git a/lib/igt_amd.h b/lib/igt_amd.h
index bce4657cbcfd..217ee6dcbd02 100644
--- a/lib/igt_amd.h
+++ b/lib/igt_amd.h
@@ -210,7 +210,7 @@ int igt_amd_trigger_hotplug(int drm_fd, char *connector_name);

/* IGT link helper functions */
void igt_amd_read_link_settings(
- int drm_fd, char *connector_name, int *lane_count, int *link_rate, int *link_spread);
+ int drm_fd, const char *connector_name, int *lane_count, int *link_rate, int *link_spread);
void igt_amd_write_link_settings(
int drm_fd, char *connector_name, enum dc_lane_count lane_count,
enum dc_link_rate link_rate, enum dc_link_training_type training_type);

--
2.52.0