mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
Merge "mhi: core: Fix find_last_bit() usage"
This commit is contained in:
commit
706d4a2ae6
1 changed files with 5 additions and 2 deletions
|
|
@ -92,9 +92,12 @@ struct mhi_controller *find_mhi_controller_by_name(const char *name)
|
|||
|
||||
const char *to_mhi_pm_state_str(enum MHI_PM_STATE state)
|
||||
{
|
||||
int index = find_last_bit((unsigned long *)&state, 32);
|
||||
int index;
|
||||
|
||||
if (index >= ARRAY_SIZE(mhi_pm_state_str))
|
||||
if (state)
|
||||
index = __fls(state);
|
||||
|
||||
if (!state || index >= ARRAY_SIZE(mhi_pm_state_str))
|
||||
return "Invalid State";
|
||||
|
||||
return mhi_pm_state_str[index];
|
||||
|
|
|
|||
Loading…
Reference in a new issue