linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 08/28] iwlwifi: some coding styles cleanup
Date: Wed,  8 Aug 2007 15:33:25 +0800	[thread overview]
Message-ID: <11865584452614-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1186558443548-git-send-email-yi.zhu@intel.com>

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwl-base.c |   54 ++++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c
index e58dcfa..8f55f0d 100644
--- a/drivers/net/wireless/iwl-base.c
+++ b/drivers/net/wireless/iwl-base.c
@@ -901,15 +901,15 @@ static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
 	int counter = 1;
 
 	if (rxon->flags & RXON_FLG_BAND_24G_MSK) {
-		error |=
-			le32_to_cpu(rxon->flags & RXON_FLG_TGJ_NARROW_BAND_MSK);
-		error |= le32_to_cpu(rxon->flags & RXON_FLG_RADAR_DETECT_MSK);
+		error |= le32_to_cpu(rxon->flags &
+				(RXON_FLG_TGJ_NARROW_BAND_MSK |
+				 RXON_FLG_RADAR_DETECT_MSK));
 		if (error)
 			IWL_WARNING("check 24G fields %d | %d\n",
 				    counter++, error);
 	} else {
-		error |= ((rxon->flags & RXON_FLG_SHORT_SLOT_MSK) !=
-			RXON_FLG_SHORT_SLOT_MSK);
+		error |= (rxon->flags & RXON_FLG_SHORT_SLOT_MSK) ?
+				0 : le32_to_cpu(RXON_FLG_SHORT_SLOT_MSK);
 		if (error)
 			IWL_WARNING("check 52 fields %d | %d\n",
 				    counter++, error);
@@ -917,7 +917,6 @@ static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
 		if (error)
 			IWL_WARNING("check 52 CCK %d | %d\n",
 				    counter++, error);
-
 	}
 	error |= (rxon->node_addr[0] | rxon->bssid_addr[0]) & 0x1;
 	if (error)
@@ -925,7 +924,7 @@ static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
 
 	/* make sure basic rates 6Mbps and 1Mbps are supported */
 	error |= (((rxon->ofdm_basic_rates & IWL_RATE_6M_MASK) == 0) &&
-		((rxon->cck_basic_rates & IWL_RATE_1M_MASK) == 0));
+		  ((rxon->cck_basic_rates & IWL_RATE_1M_MASK) == 0));
 	if (error)
 		IWL_WARNING("check basic rate %d | %d\n", counter++, error);
 
@@ -933,43 +932,39 @@ static int iwl_check_rxon_cmd(struct iwl_rxon_cmd *rxon)
 	if (error)
 		IWL_WARNING("check assoc id %d | %d\n", counter++, error);
 
-	error |= ((rxon->flags &
-		   (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK)) ==
-		  (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK));
+	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK))
+			== (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK));
 	if (error)
 		IWL_WARNING("check CCK and short slot %d | %d\n",
 			    counter++, error);
 
 	error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK))
-		  == (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK));
+			== (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK));
 	if (error)
 		IWL_WARNING("check CCK & auto detect %d | %d\n",
 			    counter++, error);
 
-	error |= ((rxon->flags &
-		   (RXON_FLG_AUTO_DETECT_MSK | RXON_FLG_TGG_PROTECT_MSK)) ==
-		  RXON_FLG_TGG_PROTECT_MSK);
+	error |= ((rxon->flags & (RXON_FLG_AUTO_DETECT_MSK |
+			RXON_FLG_TGG_PROTECT_MSK)) == RXON_FLG_TGG_PROTECT_MSK);
 	if (error)
-		IWL_WARNING("check TGG %d | %d\n", counter++, error);
+		IWL_WARNING("check TGG and auto detect %d | %d\n",
+			    counter++, error);
 
 #if IWL == 3945
 	if ((rxon->flags & RXON_FLG_DIS_DIV_MSK))
-		error |= ((rxon->flags &
-			   (RXON_FLG_ANT_B_MSK | RXON_FLG_ANT_A_MSK)) == 0);
+		error |= ((rxon->flags & (RXON_FLG_ANT_B_MSK |
+				RXON_FLG_ANT_A_MSK)) == 0);
 	if (error)
 		IWL_WARNING("check antenna %d %d\n", counter++, error);
 #endif
-
 	if (error)
 		IWL_WARNING("Tuning to channel %d\n",
 			    le16_to_cpu(rxon->channel));
 
 	if (error) {
-		IWL_ERROR
-		    ("Error not a valid iwl_rxon_assoc_cmd field values\n");
+		IWL_ERROR("Not a valid iwl_rxon_assoc_cmd field values\n");
 		return -1;
 	}
-
 	return 0;
 }
 
@@ -1512,7 +1507,7 @@ static int iwl_send_beacon_cmd(struct iwl_priv *priv)
 	frame = iwl_get_free_frame(priv);
 
 	if (!frame) {
-		IWL_ERROR("Coult not obtain free frame buffer for beacon "
+		IWL_ERROR("Could not obtain free frame buffer for beacon "
 			  "command.\n");
 		return -ENOMEM;
 	}
@@ -1642,9 +1637,6 @@ void iwl_report_frame(struct iwl_priv *priv,
 	u32 print_dump = 0;	/* set to 1 to dump all frames' contents */
 	u32 hundred = 0;
 	u32 dataframe = 0;
-
-	/* these are declared without "=" to avoid compiler warnings if we
-	 *   don't use them in the debug messages below */
 	u16 frame_ctl;
 	u16 seq_ctl;
 	u16 channel;
@@ -1659,7 +1651,6 @@ void iwl_report_frame(struct iwl_priv *priv,
 	u8 agc;
 	u16 sig_avg;
 	u16 noise_diff;
-
 	struct iwl_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
 	struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
 	struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
@@ -2325,12 +2316,10 @@ static int iwl_scan_cancel(struct iwl_priv *priv, unsigned long ms)
 		} else
 			IWL_DEBUG_SCAN("Scan abort already in progress.\n");
 
-
 		mutex_unlock(&priv->mutex);
 		if (ms)
-			while (!time_after(jiffies,
-					   now + msecs_to_jiffies(ms)) &&
-			       priv->status & STATUS_SCANNING)
+			while (!time_after(jiffies, now + msecs_to_jiffies(ms))
+					&& priv->status & STATUS_SCANNING)
 				msleep(1);
 
 		mutex_lock(&priv->mutex);
@@ -3914,8 +3903,9 @@ static void iwl_rx_reply_scan(struct iwl_priv *priv,
 			      struct iwl_rx_mem_buffer *rxb)
 {
 	struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
-	struct iwl_scanreq_notification *notif =
-	    (struct iwl_scanreq_notification *)pkt->u.raw;
+	struct iwl_scanstart_notification *notif =
+	    (struct iwl_scanstart_notification *)pkt->u.raw;
+
 	IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status);
 }
 
-- 
1.5.2

  reply	other threads:[~2007-08-08  7:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11865584251026-git-send-email-yi.zhu@intel.com>
2007-08-08  7:33 ` [PATCH 01/28] iwlwifi: fix a lot of checkpatch.pl warnings Zhu Yi
2007-08-08  7:33   ` [PATCH 02/28] iwlwifi: add more Kconfig options Zhu Yi
2007-08-08  7:33     ` [PATCH 03/28] iwlwifi: Endianity fix for 4965 rate scaling Zhu Yi
2007-08-08  7:33       ` [PATCH 04/28] iwlwifi: Endianity fix for 4965 rx chain selection Zhu Yi
2007-08-08  7:33         ` [PATCH 05/28] iwlwifi: optimize iwl_queue_{inc|dec}_wrap implementation Zhu Yi
2007-08-08  7:33           ` [PATCH 06/28] iwlwifi: use mask operation to replace '%' for index calculation Zhu Yi
2007-08-08  7:33             ` [PATCH 07/28] iwlwifi: make local functions static Zhu Yi
2007-08-08  7:33               ` Zhu Yi [this message]
2007-08-08  7:33                 ` [PATCH 09/28] iwlwifi: replace unnecessary GFP_ATOMIC with GFP_KERNEL Zhu Yi
2007-08-08  7:33                   ` [PATCH 10/28] iwlwifi: remove priv stuff zeroing in iwl_pci_probe Zhu Yi
2007-08-08  7:33                     ` [PATCH 11/28] iwlwifi: add name for some PCI configuration space registers Zhu Yi
2007-08-08  7:33                       ` [PATCH 12/28] iwlwifi: shorten some structure and function names Zhu Yi
2007-08-08  7:33                         ` [PATCH 13/28] iwlwifi: define iwl_rx_reply_scan only when CONFIG_IWLWIFI_DEBUG enabled Zhu Yi
2007-08-08  7:33                           ` [PATCH 14/28] iwlwifi: remove redundant quotes Zhu Yi
2007-08-08  7:33                             ` [PATCH 15/28] iwlwifi: Endianity fix for rxon host commands Zhu Yi
2007-08-08  7:33                               ` [PATCH 16/28] iwlwifi: Endianity fix for beacon host command Zhu Yi
2007-08-08  7:33                                 ` [PATCH 17/28] iwlwifi: Endianity fix for channel number Zhu Yi
2007-08-08  7:33                                   ` [PATCH 18/28] iwlwifi: shorten more function names Zhu Yi
2007-08-08  7:33                                     ` [PATCH 19/28] iwlwifi: make iwl_get_bits inline function from macro Zhu Yi
2007-08-08  7:33                                       ` [PATCH 20/28] iwlwifi: remove BIT_FMT and BIT_ARG Zhu Yi
2007-08-08  7:33                                         ` [PATCH 21/28] iwlwifi: remove WLAN_FC_GET_TYPE macros Zhu Yi
2007-08-08  7:33                                           ` [PATCH 22/28] iwlwifi: replace private snprint_line with common hex_dump_xxx Zhu Yi
2007-08-08  7:33                                             ` [PATCH 23/28] iwlwifi: Endianity fix for frame control Zhu Yi
2007-08-08  7:33                                               ` [PATCH 24/28] iwlwifi: Endianity fix for ct kill configuration Zhu Yi
2007-08-08  7:33                                                 ` [PATCH 25/28] iwlwifi: remove unused snprint_line Zhu Yi
2007-08-08  7:33                                                   ` [PATCH 26/28] iwlwifi: Enhance ISR/RX/CMD debug messages Zhu Yi
2007-08-08  7:33                                                     ` [PATCH 27/28] iwlwifi: Correct missing hardware detection in iwl_isr() Zhu Yi
2007-08-08  7:33                                                       ` [PATCH 28/28] iwlwifi: Streamline irq_tasklet() when ISR debug not used Zhu Yi

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=11865584452614-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).