intel/gen_decoder: Fix unused-but-set-variable warning
authorKai Wasserbäch <kai@dev.carbon-project.org>
Sat, 28 Sep 2019 16:58:57 +0000 (18:58 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Nov 2019 00:32:55 +0000 (11:32 +1100)
This commit fixes the following warning:
../src/intel/common/gen_decoder.c: In function ‘gen_spec_load_from_path’:
../src/intel/common/gen_decoder.c:741:11: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]
  741 |    size_t len, filename_len = strlen(path) + 20;
      |           ^~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/common/gen_decoder.c

index 69d7de0824ed2edcfd42518977981f17e776d5fd..97e8f168228296fd6e284862b5fa2c5993e24dbd 100644 (file)
@@ -738,10 +738,10 @@ struct gen_spec *
 gen_spec_load_from_path(const struct gen_device_info *devinfo,
                         const char *path)
 {
-   size_t len, filename_len = strlen(path) + 20;
+   size_t filename_len = strlen(path) + 20;
    char *filename = malloc(filename_len);
 
-   len = snprintf(filename, filename_len, "%s/gen%i.xml",
+   ASSERTED size_t len = snprintf(filename, filename_len, "%s/gen%i.xml",
                   path, devinfo_to_gen(devinfo, false));
    assert(len < filename_len);