replace unused attributes
[dpdk.git] / app / test / test_malloc.c
index f0e608c..232d318 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <rte_common.h>
 #include <rte_memory.h>
-#include <rte_eal_memconfig.h>
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
@@ -68,7 +67,7 @@ is_aligned(void *p, int align)
 }
 
 static int
-test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
+test_align_overlap_per_lcore(__rte_unused void *arg)
 {
        const unsigned align1 = 8,
                        align2 = 64,
@@ -139,7 +138,7 @@ test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
 }
 
 static int
-test_reordered_free_per_lcore(__attribute__((unused)) void *arg)
+test_reordered_free_per_lcore(__rte_unused void *arg)
 {
        const unsigned align1 = 8,
                        align2 = 64,
@@ -256,7 +255,7 @@ test_str_to_size(void)
                        {"18446744073709551616", 0} /* ULLONG_MAX + 1 == out of range*/
        };
        unsigned i;
-       for (i = 0; i < sizeof(test_values)/sizeof(test_values[0]); i++)
+       for (i = 0; i < RTE_DIM(test_values); i++)
                if (rte_str_to_size(test_values[i].str) != test_values[i].value)
                        return -1;
        return 0;
@@ -372,18 +371,6 @@ test_multi_alloc_statistics(void)
        return 0;
 }
 
-static int
-test_rte_malloc_type_limits(void)
-{
-       /* The type-limits functionality is not yet implemented,
-        * so always return 0 no matter what the retval.
-        */
-       const char *typename = "limit_test";
-       rte_malloc_set_limit(typename, 64 * 1024);
-       rte_malloc_dump_stats(stdout, typename);
-       return 0;
-}
-
 static int
 test_realloc(void)
 {
@@ -595,7 +582,7 @@ end:
 }
 
 static int
-test_random_alloc_free(void *_ __attribute__((unused)))
+test_random_alloc_free(void *_ __rte_unused)
 {
        struct mem_list {
                struct mem_list *next;
@@ -952,15 +939,6 @@ test_malloc(void)
        }
        else printf("test_random_alloc_free() passed\n");
 
-       /*----------------------------*/
-       ret = test_rte_malloc_type_limits();
-       if (ret < 0){
-               printf("test_rte_malloc_type_limits() failed\n");
-               return ret;
-       }
-       /* TODO: uncomment following line once type limits are valid */
-       /*else printf("test_rte_malloc_type_limits() passed\n");*/
-
        /*----------------------------*/
        ret = test_rte_malloc_validate();
        if (ret < 0){