[Mesa-dev] [PATCH 5/8] r600: remove TABLE_SIZE macro

Nicolai Hähnle nhaehnle at gmail.com
Mon May 9 16:32:24 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Use ARRAY_SIZE instead.
---
 src/gallium/drivers/r600/r600_isa.c | 4 ++--
 src/gallium/drivers/r600/r600_isa.h | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_isa.c b/src/gallium/drivers/r600/r600_isa.c
index 044f45c..2633cdc 100644
--- a/src/gallium/drivers/r600/r600_isa.c
+++ b/src/gallium/drivers/r600/r600_isa.c
@@ -568,7 +568,7 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
 			isa->alu_op2_map[opc] = i + 1;
 	}
 
-	for (i = 0; i < TABLE_SIZE(fetch_op_table); ++i) {
+	for (i = 0; i < ARRAY_SIZE(fetch_op_table); ++i) {
 		const struct fetch_op_info *op = &fetch_op_table[i];
 		unsigned opc = op->opcode[isa->hw_class];
 		if ((op->flags & FF_GDS) || ((opc & 0xFF) != opc))
@@ -576,7 +576,7 @@ int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa) {
 		isa->fetch_map[opc] = i + 1;
 	}
 
-	for (i = 0; i < TABLE_SIZE(cf_op_table); ++i) {
+	for (i = 0; i < ARRAY_SIZE(cf_op_table); ++i) {
 		const struct cf_op_info *op = &cf_op_table[i];
 		unsigned opc = op->opcode[isa->hw_class];
 		if (opc == -1)
diff --git a/src/gallium/drivers/r600/r600_isa.h b/src/gallium/drivers/r600/r600_isa.h
index 1ed52ed..b5a36b4 100644
--- a/src/gallium/drivers/r600/r600_isa.h
+++ b/src/gallium/drivers/r600/r600_isa.h
@@ -675,8 +675,6 @@ struct r600_context;
 int r600_isa_init(struct r600_context *ctx, struct r600_isa *isa);
 int r600_isa_destroy(struct r600_isa *isa);
 
-#define TABLE_SIZE(t) (sizeof(t)/sizeof(t[0]))
-
 extern const struct alu_op_info r600_alu_op_table[];
 
 unsigned
-- 
2.7.4



More information about the mesa-dev mailing list