[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110329233909.GN30482@opensource.wolfsonmicro.com>
Date: Wed, 30 Mar 2011 08:39:10 +0900
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Liam Girdwood <lrg@...mlogic.co.uk>
Cc: David Collins <collinsd@...eaurora.org>,
linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists