All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: Nick Kossifidis <mickflemm@gmail.com>
Cc: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org,
	linville@tuxdriver.com, mcgrof@gmail.com, nbd@openwrt.org,
	jirislaby@gmail.com
Subject: Re: [PATCH 13/13] ath5k: Optimize ath5k_cw_validate
Date: Sun, 20 Nov 2011 10:44:00 -0500	[thread overview]
Message-ID: <20111120154359.GA4069@hash.lan> (raw)
In-Reply-To: <1321775788-12520-14-git-send-email-mickflemm@gmail.com>

On Sun, Nov 20, 2011 at 09:56:28AM +0200, Nick Kossifidis wrote:
> +	/* Check if cw_req + 1 a power of 2 */
> +	if (!((cw_req + 1) & cw_req))
> +		return cw_req;
> +
> +	/* Check if cw_req is a power of 2 */
> +	if (!(cw_req & (cw_req - 1)))
> +		return cw_req - 1;

There's is_power_of_two() in log2.h .. but this whole thing could also
be something like roundup_pow_of_two(cw) maybe?

-- 
Bob Copeland %% www.bobcopeland.com


  reply	other threads:[~2011-11-20 16:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20  7:56 [PATCH 00/13] ath5k: A few updates + cleanups + kerneldoc Nick Kossifidis
2011-11-20  7:56 ` [PATCH 01/13] ath5k: Switch from read-and-clear to write-to-clear method when handling PISR/SISR registers Nick Kossifidis
2011-11-20  7:56 ` [PATCH 02/13] ath5k: Maintain PISR snapshot Nick Kossifidis
2011-11-20 22:43   ` Adrian Chadd
2011-11-21  3:44     ` Nick Kossifidis
2011-11-20  7:56 ` [PATCH 03/13] ath5k: Add TXNOFRM to INT_TX_ALL Nick Kossifidis
2011-11-20  7:56 ` [PATCH 04/13] ath5k: Cleanups v1 Nick Kossifidis
2011-11-20  7:56 ` [PATCH 05/13] ath5k: Calibration re-work Nick Kossifidis
2011-11-20  7:56 ` [PATCH 06/13] ath5k: Use usleep_range where possible Nick Kossifidis
2011-11-20  9:23   ` Felix Fietkau
2011-11-20 15:43     ` Nick Kossifidis
2011-11-20 16:01       ` Jiri Slaby
2011-11-20 16:10         ` Nick Kossifidis
2011-11-20  7:56 ` [PATCH 07/13] ath5k: Cleanups v2 + add kerneldoc on all hw functions Nick Kossifidis
2011-11-20  7:56 ` [PATCH 08/13] ath5k: We always do full calibration on AR5210 Nick Kossifidis
2011-11-20  7:56 ` [PATCH 09/13] ath5k: Add a module parameter to disable hw rf kill switch Nick Kossifidis
2011-11-20  7:56 ` [PATCH 10/13] ath5k: MRR support and 2GHz radio override belong in ah_capabilities Nick Kossifidis
2011-11-20  7:56 ` [PATCH 11/13] ath5k: ath5k_ani_period_restart only touches struct ath5k_ani_state Nick Kossifidis
2011-11-20  7:56 ` [PATCH 12/13] ath5k: Renumber hw queue ids Nick Kossifidis
2011-11-20  7:56 ` [PATCH 13/13] ath5k: Optimize ath5k_cw_validate Nick Kossifidis
2011-11-20 15:44   ` Bob Copeland [this message]
2011-11-20 16:15     ` Nick Kossifidis

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=20111120154359.GA4069@hash.lan \
    --to=me@bobcopeland.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.com \
    --cc=mickflemm@gmail.com \
    --cc=nbd@openwrt.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.