openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/sys-utils/lscpu.c
static int add_cpuset_to_array(cpu_set_t** ary, int* items, cpu_set_t* set)
{
    int i;
    size_t setsize = CPU_ALLOC_SIZE(maxcpus);

    if (!ary)
        return -1;

    for (i = 0; i < *items; i++)
    {
        if (CPU_EQUAL_S(setsize, set, ary[i]))
            break;
    }
    if (i == *items)
    {
        ary[*items] = set;
        ++*items;
        return 0;
    }
    CPU_FREE(set);
    return 1;
}
/* add @set to the @ary, unnecessary set is deallocated. */
add @set to the @ary, unnecessary set is deallocated.
add @set to the @ary unnecessary set is deallocated .
static int add_cpuset_to_array(cpu_set_t** ary, int* items, cpu_set_t* set)
{
    int i;
    size_t setsize = CPU_ALLOC_SIZE(maxcpus);
    if (!ary)
        return -1;
    for (i = 0; i < *items; i++)
    {
        if (CPU_EQUAL_S(setsize, set, ary[i]))
            break;
    }
    if (i == *items)
    {
        ary[*items] = set;
        ++*items;
        return 0;
    }
    CPU_FREE(set);
    return 1;
}
static int add_cpuset_to_array ( cpu_set_t * * ary , int * items , cpu_set_t * set ) { int i ; size_t setsize = CPU_ALLOC_SIZE ( maxcpus ) ; if ( ! ary ) return -1 ; for ( i = 0 ; i < * items ; i ++ ) { if ( CPU_EQUAL_S ( setsize , set , ary [ i ] ) ) break ; } if ( i == * items ) { ary [ * items ] = set ; ++ * items ; return 0 ; } CPU_FREE ( set ) ; return 1 ; }
add @set to the @ary, unnecessary set is deallocated.
add @set to the @ary unnecessary set is deallocated .