openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/utils.c
double nl_cancel_down_bits(unsigned long long l, char** unit)
{
    if (l >= 1000000000000ULL)
    {
        *unit = "Tbit";
        return ((double)l) / 1000000000000ULL;
    }

    if (l >= 1000000000)
    {
        *unit = "Gbit";
        return ((double)l) / 1000000000;
    }

    if (l >= 1000000)
    {
        *unit = "Mbit";
        return ((double)l) / 1000000;
    }

    if (l >= 1000)
    {
        *unit = "Kbit";
        return ((double)l) / 1000;
    }

    *unit = "bit";
    return (double)l;
}
/**
 * Cancel down a bit counter
 * @arg	l		bit counter
 * @arg unit		destination unit pointer
 *
 * Cancels down bit counter until it reaches a reasonable
 * unit. The chosen unit is assigned to \a unit.
 * This function assume 1000 bits in one kilobit
 *
 * @return The cancelled down bit counter in the new unit.
 */
Cancel down a bit counter
@arg l               bit counter
@arg unit            destination unit pointer

Cancels down bit counter until it reaches a reasonable
unit. The chosen unit is assigned to \a unit.
This function assume 1000 bits in one kilobit

@return The cancelled down bit counter in the new unit.
Cancel down a bit counter @arg l bit counter @arg unit destination unit pointer Cancels down bit counter until it reaches a reasonable unit . The chosen unit is assigned to \ a unit . This function assume 1000 bits in one kilobit @return The cancelled down bit counter in the new unit .
double nl_cancel_down_bits(unsigned long long l, char** unit)
{
    if (l >= 1000000000000ULL)
    {
        *unit = "Tbit";
        return ((double)l) / 1000000000000ULL;
    }
    if (l >= 1000000000)
    {
        *unit = "Gbit";
        return ((double)l) / 1000000000;
    }
    if (l >= 1000000)
    {
        *unit = "Mbit";
        return ((double)l) / 1000000;
    }
    if (l >= 1000)
    {
        *unit = "Kbit";
        return ((double)l) / 1000;
    }
    *unit = "bit";
    return (double)l;
}
double nl_cancel_down_bits ( unsigned long long l , char * * unit ) { if ( l >= 1000000000000ULL ) { * unit = " " ; return ( ( double ) l ) / 1000000000000ULL ; } if ( l >= 1000000000 ) { * unit = " " ; return ( ( double ) l ) / 1000000000 ; } if ( l >= 1000000 ) { * unit = " " ; return ( ( double ) l ) / 1000000 ; } if ( l >= 1000 ) { * unit = " " ; return ( ( double ) l ) / 1000 ; } * unit = " " ; return ( double ) l ; }
Cancel down a bit counter
 @arg l               bit counter
 @arg unit            destination unit pointer
Cancel down a bit counter @arg l bit counter @arg unit destination unit pointer