[PATCH i-g-t] lib/igt_sysfs: Remove redundant variable assignment

Pranay Samala pranay.samala at intel.com
Wed Jul 16 13:27:52 UTC 2025


Eliminate redundant assignment in debug mask setup.
Simplified the logic by directly using the input
parameter for logging and sysfs operations.

Fixes: 835f38b71973 ("lib/igt_sysfs: Update new debug mask requested by user")
Signed-off-by: Pranay Samala <pranay.samala at intel.com>
---
 lib/igt_sysfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index aec157b5b..96ca57ed9 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -506,7 +506,6 @@ void igt_drm_debug_mask_reset_exit_handler(int sig)
  */
 void igt_drm_debug_mask_update(unsigned int mask_to_set)
 {
-	unsigned int new_debug_mask;
 	static bool debug_mask_read_once = true;
 	char buf[20];
 	int dir;
@@ -525,8 +524,8 @@ void igt_drm_debug_mask_update(unsigned int mask_to_set)
 		}
 	}
 
-	igt_debug("Setting DRM debug mask to %d\n", new_debug_mask);
-	snprintf(buf, sizeof(buf), "%d", new_debug_mask);
+	igt_debug("Setting DRM debug mask to %d\n", mask_to_set);
+	snprintf(buf, sizeof(buf), "%d", mask_to_set);
 	igt_assert(igt_sysfs_set(dir, "debug", buf));
 
 	close(dir);
-- 
2.34.1



More information about the igt-dev mailing list