svga: Make use of ARRAY_SIZE macro
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Fri, 4 Dec 2015 04:31:40 +0000 (15:31 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 6 Dec 2015 16:09:52 +0000 (17:09 +0100)
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/svga/svga_state_tss.c
src/gallium/drivers/svga/svgadump/svga_shader_op.c

index 5991da13868c474aef2c50be00cbc3b17db1dedc..4debbf1669b2c59928d1ceba4d6dbfb122fbc6ce 100644 (file)
@@ -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;
index ad1549d9f81fc1e7cc7e6e7a385bd306c6b0510b..03a63cf5e2b9e70da5c01e2ef54a4f6362b9162e 100644 (file)
@@ -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 );