lkml.org 
[lkml]   [2011]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2011-03-30 01:41    [W:0.062 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site