qcacmn: Add qdf API to find last set bit

Add qdf wrapper for Linux fls() to find last set bit.

Change-Id: I089fee397d619515c768521bda1f4d4c35526fe0
Этот коммит содержится в:
Karunakar Dasineni
2019-10-24 14:13:19 -07:00
коммит произвёл nshrivas
родитель 91da9dce36
Коммит 8e25a3077a
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@@ -761,4 +761,17 @@ int qdf_hex_str_to_binary(u8 *dst, const char *src, size_t count)
return __qdf_hex_str_to_binary(dst, src, count);
}
/**
* qdf_fls() - find last set bit in a given 32 bit input
* @x: 32 bit mask
*
* Return: zero if the input is zero, otherwise returns the bit
* position of the last set bit, where the LSB is 1 and MSB is 32.
*/
static inline
int qdf_fls(uint32_t x)
{
return __qdf_fls(x);
}
#endif /*_QDF_UTIL_H*/