acrn-hypervisor/hypervisor/lib
Xiangyang Wu 13d354e7a6 HV:treewide:Update return type for bit operations fls and clz
Change the return type of function fls and clz as uint16_t;
When the input is zero, INVALID_BIT_INDEX is returned;
Update temporary variable type and return value check of caller
when it call fls or clz;
When input value is zero, clz returns 32 directly.

V1-->V2:
        INVALID_BIT_INDEX instead of INVALID_NUMBER;
        Add type conversion as needed;
        Add "U/UL" for constant value as needed;
        Codeing style fixing.
V2-->V3:
       Use type conversion to remove side effect of
       the variable which stores fls/clz return value;
       fls return INVALID_BIT_INDEX directly when the
       input value is zero.
V3-->v4:
       Clean up comments for fls.

Note: For instruction "bsrl", destination register value
      is undefined when source register value is zero.

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-02 15:11:22 +08:00
..
crypto license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
div.c HV:treewide:Update return type for bit operations fls and clz 2018-07-02 15:11:22 +08:00
mdelay.c license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
memory.c HV: treewide: convert hexadecimals used in bitops to unsigned 2018-06-21 13:12:39 +08:00
spinlock.c fix parted of "missing for discarded return value" 2018-06-19 16:21:45 +08:00
sprintf.c HV: treewide: convert suffix ULL to UL 2018-06-29 00:50:01 +08:00
string.c HV: Fix compiler warnings in string.c 2018-07-02 12:32:12 +08:00
udelay.c udelay waits for corresponding number of milliseconds passed to API. 2018-06-19 11:12:19 +08:00