[igt-dev] [PATCH i-g-t] tools/i915-perf: workaround overzelous compiler warnings

Lionel Landwerlin lionel.g.landwerlin at intel.com
Thu Feb 20 12:51:52 UTC 2020


Give me a break :)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 tools/i915-perf/i915_perf_control.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/i915-perf/i915_perf_control.c b/tools/i915-perf/i915_perf_control.c
index a8d0d30f..dcbc2f59 100644
--- a/tools/i915-perf/i915_perf_control.c
+++ b/tools/i915-perf/i915_perf_control.c
@@ -95,10 +95,12 @@ main(int argc, char *argv[])
 				struct recorder_command_base base;
 				struct recorder_command_dump dump;
 			} *data = malloc(total_len);
+			char *path = (char *) data->dump.path;
 
 			data->base.command = RECORDER_COMMAND_DUMP;
 			data->base.size = total_len;
-			snprintf((char *) data->dump.path, strlen(dump_file) + 1, "%s", dump_file);
+			snprintf(path, strlen(dump_file) + 1, "%s", dump_file);
+
 
 			fwrite(data, total_len, 1, command_fifo_file);
 		} else {
@@ -109,10 +111,11 @@ main(int argc, char *argv[])
 				struct recorder_command_base base;
 				struct recorder_command_dump dump;
 			} *data = malloc(total_len);
+			char *path = (char *) data->dump.path;
 
 			data->base.command = RECORDER_COMMAND_DUMP;
 			data->base.size = total_len;
-			snprintf((char *) data->dump.path, path_len, "%s/%s", cwd, dump_file);
+			snprintf(path, path_len, "%s/%s", cwd, dump_file);
 
 			fwrite(data, total_len, 1, command_fifo_file);
 		}
-- 
2.25.0



More information about the igt-dev mailing list