vppinfra: Improve code portability 71/41171/3
authorRenato Botelho do Couto <[email protected]>
Fri, 21 Jun 2024 14:00:10 +0000 (14:00 +0000)
committerMatthew Smith <[email protected]>
Wed, 26 Jun 2024 19:25:50 +0000 (19:25 +0000)
Use standard macros CPU_ISSET_S and CPU_ZERO_S and make code more
portable.

Type: improvement

Change-Id: I8e6a0fd79b90de8c6c33cad8882680eae2ca50ef
Signed-off-by: Renato Botelho do Couto <[email protected]>
src/vppinfra/unix-misc.c

index af48e99..88a56d8 100644 (file)
@@ -291,7 +291,7 @@ os_get_cpu_affinity_bitmap (int pid)
   clib_bitmap_alloc (affinity_cpus, sizeof (cpu_set_t));
   clib_bitmap_zero (affinity_cpus);
 
-  __CPU_ZERO_S (sizeof (cpu_set_t), &cpuset);
+  CPU_ZERO_S (sizeof (cpu_set_t), &cpuset);
 
   ret = sched_getaffinity (0, sizeof (cpu_set_t), &cpuset);
 
@@ -302,7 +302,7 @@ os_get_cpu_affinity_bitmap (int pid)
     }
 
   for (index = 0; index < sizeof (cpu_set_t); index++)
-    if (__CPU_ISSET_S (index, sizeof (cpu_set_t), &cpuset))
+    if (CPU_ISSET_S (index, sizeof (cpu_set_t), &cpuset))
       clib_bitmap_set (affinity_cpus, index, 1);
   return affinity_cpus;
 #elif defined(__FreeBSD__)