summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-11-16 13:42:41 -0800
committerMatt Turner <[email protected]>2017-11-17 12:14:38 -0800
commitf80e97346b0da9fab3d60b46bdcf0a0d702f97c9 (patch)
treef2bf8853056548c4ce813913e52e0191a6f1028e
parentf4276ef7ef4b92bdcb2f43b34ff95a3189fc0ce1 (diff)
i965: Simplify annotation_insert_error()
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/intel/compiler/intel_asm_annotation.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/intel/compiler/intel_asm_annotation.c b/src/intel/compiler/intel_asm_annotation.c
index b07a545a12e..26ab4b98188 100644
--- a/src/intel/compiler/intel_asm_annotation.c
+++ b/src/intel/compiler/intel_asm_annotation.c
@@ -159,8 +159,6 @@ void
annotation_insert_error(struct annotation_info *annotation, unsigned offset,
const char *error)
{
- struct annotation *ann;
-
if (!annotation->ann_count)
return;
@@ -175,7 +173,6 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset,
for (int i = 0; i < annotation->ann_count; i++) {
struct annotation *cur = &annotation->ann[i];
struct annotation *next = &annotation->ann[i + 1];
- ann = cur;
if (next->offset <= offset)
continue;
@@ -190,11 +187,11 @@ annotation_insert_error(struct annotation_info *annotation, unsigned offset,
next->block_start = NULL;
annotation->ann_count++;
}
- break;
- }
- if (ann->error)
- ralloc_strcat(&ann->error, error);
- else
- ann->error = ralloc_strdup(annotation->mem_ctx, error);
+ if (cur->error)
+ ralloc_strcat(&cur->error, error);
+ else
+ cur->error = ralloc_strdup(annotation->mem_ctx, error);
+ return;
+ }
}