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 char* cpu_min_mhz(struct lscpu_desc* desc, char* buf, size_t bufsz)
{
    int i;
    float cpu_freq = -1.0;
    size_t setsize = CPU_ALLOC_SIZE(maxcpus);

    if (desc->present)
    {
        for (i = 0; i < desc->ncpuspos; i++)
        {
            if (CPU_ISSET_S(real_cpu_num(desc, i), setsize, desc->present) &&
                desc->minmhz[i])
            {
                float freq = atof(desc->minmhz[i]);

                if (cpu_freq < 0.0 || freq < cpu_freq)
                    cpu_freq = freq;
            }
        }
    }
    snprintf(buf, bufsz, "%.4f", cpu_freq);
    return buf;
}
/* Read overall minimum frequency of cpu */
Read overall minimum frequency of cpu
Read overall minimum frequency of cpu
static char* cpu_min_mhz(struct lscpu_desc* desc, char* buf, size_t bufsz)
{
    int i;
    float cpu_freq = -1.0;
    size_t setsize = CPU_ALLOC_SIZE(maxcpus);
    if (desc->present)
    {
        for (i = 0; i < desc->ncpuspos; i++)
        {
            if (CPU_ISSET_S(real_cpu_num(desc, i), setsize, desc->present) &&
                desc->minmhz[i])
            {
                float freq = atof(desc->minmhz[i]);
                if (cpu_freq < 0.0 || freq < cpu_freq)
                    cpu_freq = freq;
            }
        }
    }
    snprintf(buf, bufsz, "%.4f", cpu_freq);
    return buf;
}
static char * cpu_min_mhz ( struct lscpu_desc * desc , char * buf , size_t bufsz ) { int i ; float cpu_freq = -1.0 ; size_t setsize = CPU_ALLOC_SIZE ( maxcpus ) ; if ( desc -> present ) { for ( i = 0 ; i < desc -> ncpuspos ; i ++ ) { if ( CPU_ISSET_S ( real_cpu_num ( desc , i ) , setsize , desc -> present ) && desc -> minmhz [ i ] ) { float freq = atof ( desc -> minmhz [ i ] ) ; if ( cpu_freq < 0.0 || freq < cpu_freq ) cpu_freq = freq ; } } } snprintf ( buf , bufsz , " " , cpu_freq ) ; return buf ; }
Read overall minimum frequency of cpu
Read overall minimum frequency of cpu