diff options
| author | Petri Latvala <petri.latvala@intel.com> | 2020-02-21 12:38:29 +0200 |
|---|---|---|
| committer | Petri Latvala <petri.latvala@intel.com> | 2020-02-26 11:31:04 +0200 |
| commit | 2684f182424582c66e67bcbbda77cd60901627b8 (patch) | |
| tree | d16822b4133cb1d955a17ee1db838bf7e06cc699 /tools/i915-perf/i915_perf_control.c | |
| parent | ffa98bc80f2f76b212d10b72ef7b93f842dbcb5a (diff) | |
tools/i915-perf: Fix compiler warning
Remove the _dump half of the pair of recorder command structs and use
a plain array of uint8_ts instead. Leave the struct in a comment to
act as documentation.
As a drive-by fix, add include guards to i915_perf_recorder_commands.h
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Diffstat (limited to 'tools/i915-perf/i915_perf_control.c')
| -rw-r--r-- | tools/i915-perf/i915_perf_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/i915-perf/i915_perf_control.c b/tools/i915-perf/i915_perf_control.c index a8d0d30f..be5996c0 100644 --- a/tools/i915-perf/i915_perf_control.c +++ b/tools/i915-perf/i915_perf_control.c @@ -93,12 +93,12 @@ main(int argc, char *argv[]) sizeof(struct recorder_command_base) + strlen(dump_file) + 1; struct { struct recorder_command_base base; - struct recorder_command_dump dump; + uint8_t dump[]; } *data = malloc(total_len); data->base.command = RECORDER_COMMAND_DUMP; data->base.size = total_len; - snprintf((char *) data->dump.path, strlen(dump_file) + 1, "%s", dump_file); + snprintf((char *) data->dump, strlen(dump_file) + 1, "%s", dump_file); fwrite(data, total_len, 1, command_fifo_file); } else { @@ -107,12 +107,12 @@ main(int argc, char *argv[]) uint32_t total_len = sizeof(struct recorder_command_base) + path_len; struct { struct recorder_command_base base; - struct recorder_command_dump dump; + uint8_t dump[]; } *data = malloc(total_len); data->base.command = RECORDER_COMMAND_DUMP; data->base.size = total_len; - snprintf((char *) data->dump.path, path_len, "%s/%s", cwd, dump_file); + snprintf((char *) data->dump, path_len, "%s/%s", cwd, dump_file); fwrite(data, total_len, 1, command_fifo_file); } |
