Mesa (master): intel/batch-decoder: replace local ARRAY_LENGTH() macro with global ARRAY_SIZE()
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 16 16:45:11 UTC 2018
Module: Mesa
Branch: master
Commit: d6aea403267a96d9f840e308755e3c58315a70de
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6aea403267a96d9f840e308755e3c58315a70de
Author: Eric Engestrom <eric.engestrom at intel.com>
Date: Thu Aug 16 15:37:22 2018 +0100
intel/batch-decoder: replace local ARRAY_LENGTH() macro with global ARRAY_SIZE()
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/common/gen_batch_decoder.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c
index f5be0018af..f93f4df006 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -23,6 +23,7 @@
#include "common/gen_decoder.h"
#include "gen_disasm.h"
+#include "util/macros.h"
#include <string.h>
@@ -65,8 +66,6 @@ gen_batch_decode_ctx_finish(struct gen_batch_decode_ctx *ctx)
#define GREEN_HEADER CSI "1;42m"
#define NORMAL CSI "0m"
-#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
-
static void
ctx_print_group(struct gen_batch_decode_ctx *ctx,
struct gen_group *group,
@@ -835,7 +834,7 @@ gen_print_batch(struct gen_batch_decode_ctx *ctx,
if (ctx->flags & GEN_BATCH_DECODE_FULL) {
ctx_print_group(ctx, inst, offset, p);
- for (int i = 0; i < ARRAY_LENGTH(custom_decoders); i++) {
+ for (int i = 0; i < ARRAY_SIZE(custom_decoders); i++) {
if (strcmp(inst_name, custom_decoders[i].cmd_name) == 0) {
custom_decoders[i].decode(ctx, p);
break;
More information about the mesa-commit
mailing list