From 82871081fcc963d87c5441c0b4afcb597f561516 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 4 Dec 2015 15:31:40 +1100 Subject: svga: Make use of ARRAY_SIZE macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edward O'Callaghan Signed-off-by: Marek Olšák --- src/gallium/drivers/svga/svga_state_tss.c | 2 +- src/gallium/drivers/svga/svgadump/svga_shader_op.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_state_tss.c b/src/gallium/drivers/svga/svga_state_tss.c index 5991da13868..4debbf1669b 100644 --- a/src/gallium/drivers/svga/svga_state_tss.c +++ b/src/gallium/drivers/svga/svga_state_tss.c @@ -316,7 +316,7 @@ svga_queue_tss( struct ts_queue *q, unsigned tss, unsigned value ) { - assert(q->ts_count < sizeof(q->ts)/sizeof(q->ts[0])); + assert(q->ts_count < ARRAY_SIZE(q->ts)); q->ts[q->ts_count].stage = unit; q->ts[q->ts_count].name = tss; q->ts[q->ts_count].value = value; diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_op.c b/src/gallium/drivers/svga/svgadump/svga_shader_op.c index ad1549d9f81..03a63cf5e2b 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_op.c +++ b/src/gallium/drivers/svga/svgadump/svga_shader_op.c @@ -144,7 +144,7 @@ const struct sh_opcode_info *svga_opcode_info( uint op ) { struct sh_opcode_info *info; - if (op >= sizeof( opcode_info ) / sizeof( opcode_info[0] )) { + if (op >= ARRAY_SIZE(opcode_info)) { /* The opcode is either PHASE, COMMENT, END or out of range. */ assert( 0 ); -- cgit v1.2.3