Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 706d4a2a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: core: Fix find_last_bit() usage"

parents e00d05cb 36a30662
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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];