eal: use sizeof to avoid a double use of a define
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 28 Nov 2017 14:56:16 +0000 (15:56 +0100)
committerOlivier Matz <olivier.matz@6wind.com>
Fri, 8 Dec 2017 09:51:36 +0000 (10:51 +0100)
Only a cosmetic change.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/bsdapp/eal/eal_thread.c
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal_thread.c

index 369a682..8d88119 100644 (file)
@@ -642,7 +642,7 @@ rte_eal_init(int argc, char **argv)
 
        eal_thread_init_master(rte_config.master_lcore);
 
-       ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
+       ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
 
        RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
                rte_config.master_lcore, thread_id, cpuset,
index 2a2136a..2498c47 100644 (file)
@@ -148,7 +148,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)
        if (eal_thread_set_affinity() < 0)
                rte_panic("cannot set affinity\n");
 
-       ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
+       ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
 
        RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
                lcore_id, thread_id, cpuset, ret == 0 ? "" : "...");
index 229eec9..9c7d762 100644 (file)
@@ -898,7 +898,7 @@ rte_eal_init(int argc, char **argv)
 
        eal_thread_init_master(rte_config.master_lcore);
 
-       ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
+       ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
 
        RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%x;cpuset=[%s%s])\n",
                rte_config.master_lcore, (int)thread_id, cpuset,
@@ -929,7 +929,7 @@ rte_eal_init(int argc, char **argv)
                        rte_panic("Cannot create thread\n");
 
                /* Set thread_name for aid in debugging. */
-               snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN,
+               snprintf(thread_name, sizeof(thread_name),
                        "lcore-slave-%d", i);
                ret = rte_thread_setname(lcore_config[i].thread_id,
                                                thread_name);
index e9a579e..082d091 100644 (file)
@@ -148,7 +148,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)
        if (eal_thread_set_affinity() < 0)
                rte_panic("cannot set affinity\n");
 
-       ret = eal_thread_dump_affinity(cpuset, RTE_CPU_AFFINITY_STR_LEN);
+       ret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));
 
        RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%x;cpuset=[%s%s])\n",
                lcore_id, (int)thread_id, cpuset, ret == 0 ? "" : "...");