Messages in this thread | | | Date | Wed, 30 Mar 2011 08:39:10 +0900 | From | Mark Brown <> | Subject | Re: [PATCH] regulator: When constraining modes fall back to higher power modes |
| |
On Wed, Mar 30, 2011 at 12:29:24AM +0100, Liam Girdwood wrote:
> It's late and I'm wondering if it's cleaner here just to :- > > if (mask & *mode) > return 0;
> *mode = fls(mask); > if (*mode) > return 0;
This will end up selecting the highest mode in mask, even if it's lower than the one asked for, you'd need to recheck against the original mask. There's a few ways I can think of to do that but they're none of them exceptionally pretty.
| |