aubinator: Delete redundant NULL check.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 15 Mar 2017 07:40:44 +0000 (00:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 16 Mar 2017 17:48:37 +0000 (10:48 -0700)
handle_struct_decode() is just a wrapper around decode_structure()
with a NULL check.  But the only caller already does that NULL check.

So, just use decode_structure() directly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/tools/aubinator.c

index 139637cfefa21ab18b0724d3224f01a7a17eb94c..676358f57a1db4f04597bc0b022325fa50f3b6ef 100644 (file)
@@ -161,15 +161,6 @@ decode_structure(struct gen_spec *spec, struct gen_group *strct,
    }
 }
 
-static void
-handle_struct_decode(struct gen_spec *spec, char *struct_name, uint32_t *p)
-{
-   if (struct_name == NULL)
-      return;
-   struct gen_group *struct_val = gen_spec_find_struct(spec, struct_name);
-   decode_structure(spec, struct_val, p);
-}
-
 static void
 dump_binding_table(struct gen_spec *spec, uint32_t offset)
 {
@@ -802,7 +793,9 @@ parse_commands(struct gen_spec *spec, uint32_t *cmds, int size, int engine)
             if (token != NULL) {
                printf("0x%08"PRIx64":  0x%08x : Dword %d\n",
                       offset + 4 * idx, p[idx], idx);
-               handle_struct_decode(spec,token, &p[idx]);
+               struct gen_group *struct_val =
+                  gen_spec_find_struct(spec, token);
+               decode_structure(spec, struct_val, &p[idx]);
                token = NULL;
             }
          }