app: fix volatile read for GCC >= 4.6
[dpdk.git] / app / test / test_memory.c
index f9c7037..0dd09a6 100644 (file)
@@ -60,7 +60,6 @@ test_memory(void)
        uint64_t s;
        unsigned i, j;
        const struct rte_memseg *mem;
-       volatile uint8_t x;
 
        /*
         * dump the mapped memory: the python-expect script checks
@@ -82,8 +81,7 @@ test_memory(void)
 
                /* check memory */
                for (j = 0; j<mem[i].len; j++) {
-                       x = *((uint8_t *) mem[i].addr + j);
-                       RTE_SET_USED(x);
+                       *((volatile uint8_t *) mem[i].addr + j);
                }
        }