public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: David Collins <collinsd@codeaurora.org>,
	linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] regulator: When constraining modes fall back to higher power modes
Date: Wed, 30 Mar 2011 08:39:10 +0900	[thread overview]
Message-ID: <20110329233909.GN30482@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1301441364.3402.41.camel@odin>

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.

  reply	other threads:[~2011-03-29 23:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 21:29 [PATCH] regulator: When constraining modes fall back to higher power modes Mark Brown
2011-03-29 23:29 ` Liam Girdwood
2011-03-29 23:39   ` Mark Brown [this message]
2011-03-30 19:14 ` Liam Girdwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110329233909.GN30482@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=collinsd@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=patches@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox