anv: remove unnecessary runtime copy of static string
authorEric Engestrom <eric.engestrom@intel.com>
Tue, 17 Jul 2018 15:58:22 +0000 (16:58 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 23 Jul 2018 16:56:08 +0000 (17:56 +0100)
It's actually also a bit safer, since now the compiler will warn if
the string is larger than the `.name` array.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_gem.c

index 3ba6d19..c43b5ef 100644 (file)
@@ -444,12 +444,11 @@ struct sync_merge_data {
 int
 anv_gem_sync_file_merge(struct anv_device *device, int fd1, int fd2)
 {
-   const char name[] = "anv merge fence";
    struct sync_merge_data args = {
+      .name = "anv merge fence",
       .fd2 = fd2,
       .fence = -1,
    };
-   memcpy(args.name, name, sizeof(name));
 
    int ret = anv_ioctl(fd1, SYNC_IOC_MERGE, &args);
    if (ret == -1)