iwlwifi: remove cck_flag from iwl_driver_hw_info
PATCH 3/5 iwlwifi: Beautify by removing superfluous newlines and code
In reply to Tomas WinklerFrom: Ian Schram <[email protected]>
Moving code around, lindent, and whatnot created several places where there appeared to be an 75 column "rule" instead of 80. This patch removes those that I can spot, hopefully increasing readability.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 44 +++++++++----------------- drivers/net/wireless/iwlwifi/iwl4965-base.c | 19 ++++-------- 2 files changed, 21 insertions(+), 42 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +15 -29
@@ -1352,7 +1352,6 @@ static int iwl_update_sta_key_info(struct iwl_priv *priv,break ;case ALG_TKIP :case ALG_WEP : -return -EINVAL ;default :return -EINVAL ; }
@@ -2637,11 +2636,9 @@ static void iwl_build_tx_cmd_basic(struct iwl_priv *priv,if ((fc &IEEE80211_FCTL_FTYPE ) ==IEEE80211_FTYPE_MGMT ) {if ((fc &IEEE80211_FCTL_STYPE ) ==IEEE80211_STYPE_ASSOC_REQ || (fc &IEEE80211_FCTL_STYPE ) ==IEEE80211_STYPE_REASSOC_REQ ) - cmd->cmd.tx.timeout.pm_frame_timeout = -cpu_to_le16 (3 ); + cmd->cmd.tx.timeout.pm_frame_timeout =cpu_to_le16 (3 );else - cmd->cmd.tx.timeout.pm_frame_timeout = -cpu_to_le16 (2 ); + cmd->cmd.tx.timeout.pm_frame_timeout =cpu_to_le16 (2 ); }else cmd->cmd.tx.timeout.pm_frame_timeout =0 ;
@@ -3140,24 +3137,21 @@ int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)int index = mac[5 ] & (IWL_IBSS_MAC_HASH_SIZE -1 );__list_for_each (p, &priv->ibss_mac_hash[index]) { - entry = - list_entry(p, struct iwl_ibss_seq, list); + entry = list_entry(p, struct iwl_ibss_seq, list);if (!compare_ether_addr (entry->mac, mac))break ; }if (p == &priv->ibss_mac_hash[index]) { entry =kzalloc (sizeof (*entry),GFP_ATOMIC );if (!entry) { -IWL_ERROR - ("Cannot malloc new mac entry\n" ); +IWL_ERROR ("Cannot malloc new mac entry\n" );return 0 ; }memcpy (entry->mac, mac,ETH_ALEN ); entry->seq_num = seq; entry->frag_num = frag; entry->packet_time = jiffies; -list_add (&entry->list, - &priv->ibss_mac_hash[index]); +list_add (&entry->list, &priv->ibss_mac_hash[index]);return 0 ; } last_seq = &entry->seq_num;
@@ -3304,9 +3298,8 @@ static int iwl_get_measurement(struct iwl_priv *priv,switch (spectrum_resp_status) {case 0 :/* Command will be handled */ if (res->u.spectrum.id !=0xff ) { -IWL_DEBUG_INFO - ("Replaced existing measurement: %d\n" , - res->u.spectrum.id); +IWL_DEBUG_INFO ("Replaced existing measurement: %d\n" , + res->u.spectrum.id); priv->measurement_status &= ~MEASUREMENT_READY ; } priv->measurement_status |=MEASUREMENT_ACTIVE ;
@@ -5504,8 +5497,7 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 * image, u32 len)iwl_release_restricted_access (priv);if (!errcnt) -IWL_DEBUG_INFO - ("ucode image in INSTRUCTION memory is good\n" ); +IWL_DEBUG_INFO ("ucode image in INSTRUCTION memory is good\n" );return rc; }
@@ -5804,16 +5796,11 @@ static int iwl_read_ucode(struct iwl_priv *priv) boot_size =le32_to_cpu (ucode->boot_size);IWL_DEBUG_INFO ("f/w package hdr ucode version = 0x%x\n" , ver); -IWL_DEBUG_INFO ("f/w package hdr runtime inst size = %u\n" , - inst_size); -IWL_DEBUG_INFO ("f/w package hdr runtime data size = %u\n" , - data_size); -IWL_DEBUG_INFO ("f/w package hdr init inst size = %u\n" , - init_size); -IWL_DEBUG_INFO ("f/w package hdr init data size = %u\n" , - init_data_size); -IWL_DEBUG_INFO ("f/w package hdr boot inst size = %u\n" , - boot_size); +IWL_DEBUG_INFO ("f/w package hdr runtime inst size = %u\n" , inst_size); +IWL_DEBUG_INFO ("f/w package hdr runtime data size = %u\n" , data_size); +IWL_DEBUG_INFO ("f/w package hdr init inst size = %u\n" , init_size); +IWL_DEBUG_INFO ("f/w package hdr init data size = %u\n" , init_data_size); +IWL_DEBUG_INFO ("f/w package hdr boot inst size = %u\n" , boot_size);/* Verify size of file vs. image size info in file's header */ if (ucode_raw->size < sizeof(*ucode) +
@@ -6788,7 +6775,7 @@ static void iwl_bg_post_associate(struct work_struct *data)default :IWL_ERROR ("%s Should not be called in %d mode\n" , - __FUNCTION__, priv->iw_mode); + __FUNCTION__, priv->iw_mode);break ; }
@@ -6802,8 +6789,7 @@ static void iwl_bg_post_associate(struct work_struct *data)static void iwl_bg_abort_scan (struct work_struct *work) { - struct iwl_priv *priv = container_of(work, struct iwl_priv, - abort_scan); + struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);if (!iwl_is_ready (priv))return ;
drivers/net/wireless/iwlwifi/iwl4965-base.c +6 -13
@@ -1384,7 +1384,6 @@ static int iwl_update_sta_key_info(struct iwl_priv *priv,break ;case ALG_TKIP :case ALG_WEP : -return -EINVAL ;default :return -EINVAL ; }
@@ -2719,11 +2718,9 @@ static void iwl_build_tx_cmd_basic(struct iwl_priv *priv,if ((fc &IEEE80211_FCTL_FTYPE ) ==IEEE80211_FTYPE_MGMT ) {if ((fc &IEEE80211_FCTL_STYPE ) ==IEEE80211_STYPE_ASSOC_REQ || (fc &IEEE80211_FCTL_STYPE ) ==IEEE80211_STYPE_REASSOC_REQ ) - cmd->cmd.tx.timeout.pm_frame_timeout = -cpu_to_le16 (3 ); + cmd->cmd.tx.timeout.pm_frame_timeout =cpu_to_le16 (3 );else - cmd->cmd.tx.timeout.pm_frame_timeout = -cpu_to_le16 (2 ); + cmd->cmd.tx.timeout.pm_frame_timeout =cpu_to_le16 (2 ); }else cmd->cmd.tx.timeout.pm_frame_timeout =0 ;
@@ -3227,24 +3224,21 @@ int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr *header)int index = mac[5 ] & (IWL_IBSS_MAC_HASH_SIZE -1 );__list_for_each (p, &priv->ibss_mac_hash[index]) { - entry = - list_entry(p, struct iwl_ibss_seq, list); + entry = list_entry(p, struct iwl_ibss_seq, list);if (!compare_ether_addr (entry->mac, mac))break ; }if (p == &priv->ibss_mac_hash[index]) { entry =kzalloc (sizeof (*entry),GFP_ATOMIC );if (!entry) { -IWL_ERROR - ("Cannot malloc new mac entry\n" ); +IWL_ERROR ("Cannot malloc new mac entry\n" );return 0 ; }memcpy (entry->mac, mac,ETH_ALEN ); entry->seq_num = seq; entry->frag_num = frag; entry->packet_time = jiffies; -list_add (&entry->list, - &priv->ibss_mac_hash[index]); +list_add (&entry->list, &priv->ibss_mac_hash[index]);return 0 ; } last_seq = &entry->seq_num;
@@ -7190,8 +7184,7 @@ static void iwl_bg_post_associate(struct work_struct *data)static void iwl_bg_abort_scan (struct work_struct *work) { - struct iwl_priv *priv = container_of(work, struct iwl_priv, - abort_scan); + struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);if (!iwl_is_ready (priv))return ;
Signature · 8 lines
1.5.2.2 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 4/5 iwlwifi: remove late null-check and duplicate bug_on
From: Ian Schram <[email protected]>
These pieces of code appear to be useless. The BUG_ON is also performed in iwl_send_cmd_async.
Serious karma would be needed to enter iwl_ativate_qos with a null priv. I had a deja vu when patching this, but for the life of me I couldn't track down a similar patch.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 7 ------- drivers/net/wireless/iwlwifi/iwl4965-base.c | 7 ------- 2 files changed, 0 insertions(+), 14 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +0 -7
@@ -809,10 +809,6 @@ out:int iwl_send_cmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd) { -/* A command can not be asynchronous AND expect an SKB to be set. */ -BUG_ON ((cmd->meta.flags &CMD_ASYNC ) && - (cmd->meta.flags &CMD_WANT_SKB )); -if (cmd->meta.flags &CMD_ASYNC )return iwl_send_cmd_async (priv, cmd);
@@ -1958,9 +1954,6 @@ static void iwl_activate_qos(struct iwl_priv *priv, u8 force) {unsigned long flags; -if (priv ==NULL ) -return ; -if (test_bit (STATUS_EXIT_PENDING , &priv->status))return ;
drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -7
@@ -807,10 +807,6 @@ out:int iwl_send_cmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd) { -/* A command can not be asynchronous AND expect an SKB to be set. */ -BUG_ON ((cmd->meta.flags &CMD_ASYNC ) && - (cmd->meta.flags &CMD_WANT_SKB )); -if (cmd->meta.flags &CMD_ASYNC )return iwl_send_cmd_async (priv, cmd);
@@ -2030,9 +2026,6 @@ static void iwl_activate_qos(struct iwl_priv *priv, u8 force) {unsigned long flags; -if (priv ==NULL ) -return ; -if (test_bit (STATUS_EXIT_PENDING , &priv->status))return ;
Signature · 8 lines
1.5.2.2 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 1/5 iwlwifi: remove cck_flag from iwl_driver_hw_info
This patch remove cck_flag from iwl_driver_hw_info, this flag is unused
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 1 - drivers/net/wireless/iwlwifi/iwl-4965.c | 2 -- drivers/net/wireless/iwlwifi/iwl3945-base.c | 6 ++++-- drivers/net/wireless/iwlwifi/iwlwifi.h | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +0 -1
@@ -2211,7 +2211,6 @@ int iwl_hw_set_hw_setting(struct iwl_priv *priv) priv->hw_setting.tx_cmd_len =sizeof (struct iwl_tx_cmd ); priv->hw_setting.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_setting.max_rxq_log =RX_QUEUE_SIZE_LOG ; - priv->hw_setting.cck_flag =0 ; priv->hw_setting.max_stations =IWL3945_STATION_COUNT ; priv->hw_setting.bcast_sta_id =IWL3945_BROADCAST_ID ;return 0 ;
drivers/net/wireless/iwlwifi/iwl-4965.c +0 -2
@@ -1722,8 +1722,6 @@ int iwl_hw_set_hw_setting(struct iwl_priv *priv) priv->hw_setting.max_txq_num = iwl_param_queues_num; priv->hw_setting.ac_queue_count =AC_NUM ; - - priv->hw_setting.cck_flag =RATE_MCS_CCK_MSK ; priv->hw_setting.tx_cmd_len =sizeof (struct iwl_tx_cmd ); priv->hw_setting.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_setting.max_rxq_log =RX_QUEUE_SIZE_LOG ;
drivers/net/wireless/iwlwifi/iwl3945-base.c +4 -2
@@ -507,8 +507,10 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags) station->sta.sta.sta_id = index; station->sta.station_flags =0 ; - rate = (priv->phymode ==MODE_IEEE80211A ) ?IWL_RATE_6M_PLCP : -IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag; +if (priv->phymode ==MODE_IEEE80211A ) + rate =IWL_RATE_6M_PLCP ; +else + rate =IWL_RATE_1M_PLCP ;/* Turn on both antennas for the station... */ station->sta.rate_n_flags =
drivers/net/wireless/iwlwifi/iwlwifi.h +1 -2
@@ -532,11 +532,10 @@ struct iwl_ibss_seq {struct iwl_driver_hw_info {u16 max_txq_num;u16 ac_queue_count; -u32 rx_buffer_size;u16 tx_cmd_len;u16 max_rxq_size; +u32 rx_buffer_size;u16 max_rxq_log; -u32 cck_flag;u8 max_stations;u8 bcast_sta_id;void *shared_virt;
Signature · 8 lines
1.5.2.2 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 2/5 iwlwifi: Two comments in iwl-3945.c were longer than 80 columns
From: Ian Schram <[email protected]>
This patch shorten two comments lines in iwl-3945.c
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +6 -4
@@ -1137,8 +1137,9 @@ int iwl_hw_nic_reset(struct iwl_priv *priv) }/** -* iwl_hw_reg_adjust_power_by_temp - return index delta into power gain settings table -*/ +* iwl_hw_reg_adjust_power_by_temp +* return index delta into power gain settings table +*/ static int iwl_hw_reg_adjust_power_by_temp (int new_reading,int old_reading) {return (new_reading - old_reading) * (-11 ) /100 ;
@@ -1158,8 +1159,9 @@ int iwl_hw_get_temperature(struct iwl_priv *priv) }/** -* iwl_hw_reg_txpower_get_temperature - get current temperature by reading from NIC -*/ +* iwl_hw_reg_txpower_get_temperature +* get the current temperature by reading from NIC +*/ static int iwl_hw_reg_txpower_get_temperature (struct iwl_priv *priv) {int temperature;
Signature · 8 lines
1.5.2.2 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 5/5 iwlwifi: remove cck_power_index_compensation
In reply to Tomas Winklercck_power_index_compensation variable was never used
--- drivers/net/wireless/iwlwifi/iwl-priv.h | 1 - drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 -- 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-priv.h +0 -1
@@ -278,7 +278,6 @@ struct iwl_priv {#define IWL_DEFAULT_TX_POWER 0x0Fs8 user_txpower_limit;s8 max_channel_txpower_limit; -u32 cck_power_index_compensation;#ifdef CONFIG_PM u32 pm_state[16 ];
drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -2
@@ -8982,8 +8982,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) priv->channel_width =IWL_CHANNEL_WIDTH_40MHZ ; priv->valid_antenna =0x7 ;/* assume all 3 connected */ priv->ps_mode =IWL_MIMO_PS_NONE ; - priv->cck_power_index_compensation =iwl_read32 ( - priv,CSR_HW_REV_WA_REG );iwl4965_set_rxon_chain (priv);
Signature · 8 lines
1.5.2.2 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.