Linux wireless drivers development
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] WIRELESS:  Use more obvious "is_power_of_2" macro.
Date: Thu, 08 Nov 2007 16:56:58 +0800	[thread overview]
Message-ID: <1194512218.31257.308.camel@debian.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0711060945510.5429@localhost.localdomain>


On Tue, 2007-11-06 at 09:47 -0500, Robert P. J. Day wrote:
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
> 

NACK. is_power_of_2() cannot do compile time check for
TFD_QUEUE_SIZE_MAX. Furthermore, the runtime check for
TFD_QUEUE_SIZE_MAX is already done by iwl_queue_init().

Thanks,
-yi

> ---
> 
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |    3 ++-
>  drivers/net/wireless/iwlwifi/iwl4965-base.c |    3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> index 4f22a71..53b4b4e 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -50,6 +50,7 @@
>  #include <linux/firmware.h>
>  #include <linux/etherdevice.h>
>  #include <linux/if_arp.h>
> +#include <linux/log2.h>
> 
>  #include <net/ieee80211_radiotap.h>
>  #include <net/mac80211.h>
> @@ -343,7 +344,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv,
> 
>  	/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
>  	 * iwl_queue_inc_wrap and iwl_queue_dec_wrap are broken. */
> -	BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
> +	BUILD_BUG_ON(!is_power_of_2(TFD_QUEUE_SIZE_MAX));
>  	iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
> 
>  	iwl_hw_tx_queue_init(priv, txq);
> diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> index d60adcb..5f3bcb3 100644
> --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
> @@ -50,6 +50,7 @@
>  #include <linux/firmware.h>
>  #include <linux/etherdevice.h>
>  #include <linux/if_arp.h>
> +#include <linux/log2.h>
> 
>  #include <net/ieee80211_radiotap.h>
>  #include <net/mac80211.h>
> @@ -342,7 +343,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv,
> 
>  	/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
>  	 * iwl_queue_inc_wrap and iwl_queue_dec_wrap are broken. */
> -	BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
> +	BUILD_BUG_ON(!is_power_of_2(TFD_QUEUE_SIZE_MAX));
>  	iwl_queue_init(priv, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
> 
>  	iwl_hw_tx_queue_init(priv, txq);
> 

  reply	other threads:[~2007-11-08  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 14:47 [PATCH] WIRELESS: Use more obvious "is_power_of_2" macro Robert P. J. Day
2007-11-08  8:56 ` Zhu Yi [this message]
2007-11-08 11:38   ` Robert P. J. Day

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=1194512218.31257.308.camel@debian.sh.intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /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