diff options
author | Zhu Yi <yi.zhu@intel.com> | 2010-02-25 01:15:26 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-10 17:09:37 -0500 |
commit | 04d1c22761f33ac8f345665e7ef809c875142425 (patch) | |
tree | 3fc3676c87e89684819600b800240c2d5c9369fe /drivers | |
parent | 7d49c6111c27f0e68b0310aeececf7ded53f7f94 (diff) |
iwmc3200wifi: remove "_safe" for some list_for_each_entry usage
Use list_for_each_entry instead of list_for_each_entry_safe in
places iteration against list entry removal is not required.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/cfg80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/debugfs.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/hal.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/rx.c | 15 |
5 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c index 7c4f44a9c3e6..6778e5838fe6 100644 --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c | |||
@@ -263,7 +263,7 @@ static int iwm_cfg80211_get_station(struct wiphy *wiphy, | |||
263 | int iwm_cfg80211_inform_bss(struct iwm_priv *iwm) | 263 | int iwm_cfg80211_inform_bss(struct iwm_priv *iwm) |
264 | { | 264 | { |
265 | struct wiphy *wiphy = iwm_to_wiphy(iwm); | 265 | struct wiphy *wiphy = iwm_to_wiphy(iwm); |
266 | struct iwm_bss_info *bss, *next; | 266 | struct iwm_bss_info *bss; |
267 | struct iwm_umac_notif_bss_info *umac_bss; | 267 | struct iwm_umac_notif_bss_info *umac_bss; |
268 | struct ieee80211_mgmt *mgmt; | 268 | struct ieee80211_mgmt *mgmt; |
269 | struct ieee80211_channel *channel; | 269 | struct ieee80211_channel *channel; |
@@ -271,7 +271,7 @@ int iwm_cfg80211_inform_bss(struct iwm_priv *iwm) | |||
271 | s32 signal; | 271 | s32 signal; |
272 | int freq; | 272 | int freq; |
273 | 273 | ||
274 | list_for_each_entry_safe(bss, next, &iwm->bss_list, node) { | 274 | list_for_each_entry(bss, &iwm->bss_list, node) { |
275 | umac_bss = bss->bss; | 275 | umac_bss = bss->bss; |
276 | mgmt = (struct ieee80211_mgmt *)(umac_bss->frame_buf); | 276 | mgmt = (struct ieee80211_mgmt *)(umac_bss->frame_buf); |
277 | 277 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/debugfs.c b/drivers/net/wireless/iwmc3200wifi/debugfs.c index be992ca41cf1..6ac5c8dbe051 100644 --- a/drivers/net/wireless/iwmc3200wifi/debugfs.c +++ b/drivers/net/wireless/iwmc3200wifi/debugfs.c | |||
@@ -265,7 +265,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp, | |||
265 | size_t count, loff_t *ppos) | 265 | size_t count, loff_t *ppos) |
266 | { | 266 | { |
267 | struct iwm_priv *iwm = filp->private_data; | 267 | struct iwm_priv *iwm = filp->private_data; |
268 | struct iwm_rx_ticket_node *ticket, *next; | 268 | struct iwm_rx_ticket_node *ticket; |
269 | char *buf; | 269 | char *buf; |
270 | int buf_len = 4096, i; | 270 | int buf_len = 4096, i; |
271 | size_t len = 0; | 271 | size_t len = 0; |
@@ -280,7 +280,7 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp, | |||
280 | if (!buf) | 280 | if (!buf) |
281 | return -ENOMEM; | 281 | return -ENOMEM; |
282 | 282 | ||
283 | list_for_each_entry_safe(ticket, next, &iwm->rx_tickets, node) { | 283 | list_for_each_entry(ticket, &iwm->rx_tickets, node) { |
284 | len += snprintf(buf + len, buf_len - len, "Ticket #%d\n", | 284 | len += snprintf(buf + len, buf_len - len, "Ticket #%d\n", |
285 | ticket->ticket->id); | 285 | ticket->ticket->id); |
286 | len += snprintf(buf + len, buf_len - len, "\taction: 0x%x\n", | 286 | len += snprintf(buf + len, buf_len - len, "\taction: 0x%x\n", |
@@ -290,12 +290,13 @@ static ssize_t iwm_debugfs_rx_ticket_read(struct file *filp, | |||
290 | } | 290 | } |
291 | 291 | ||
292 | for (i = 0; i < IWM_RX_ID_HASH; i++) { | 292 | for (i = 0; i < IWM_RX_ID_HASH; i++) { |
293 | struct iwm_rx_packet *packet, *nxt; | 293 | struct iwm_rx_packet *packet; |
294 | struct list_head *pkt_list = &iwm->rx_packets[i]; | 294 | struct list_head *pkt_list = &iwm->rx_packets[i]; |
295 | |||
295 | if (!list_empty(pkt_list)) { | 296 | if (!list_empty(pkt_list)) { |
296 | len += snprintf(buf + len, buf_len - len, | 297 | len += snprintf(buf + len, buf_len - len, |
297 | "Packet hash #%d\n", i); | 298 | "Packet hash #%d\n", i); |
298 | list_for_each_entry_safe(packet, nxt, pkt_list, node) { | 299 | list_for_each_entry(packet, pkt_list, node) { |
299 | len += snprintf(buf + len, buf_len - len, | 300 | len += snprintf(buf + len, buf_len - len, |
300 | "\tPacket id: %d\n", | 301 | "\tPacket id: %d\n", |
301 | packet->id); | 302 | packet->id); |
diff --git a/drivers/net/wireless/iwmc3200wifi/hal.c b/drivers/net/wireless/iwmc3200wifi/hal.c index d13c8853ee82..96caab4bbe58 100644 --- a/drivers/net/wireless/iwmc3200wifi/hal.c +++ b/drivers/net/wireless/iwmc3200wifi/hal.c | |||
@@ -206,9 +206,9 @@ void iwm_cmd_flush(struct iwm_priv *iwm) | |||
206 | 206 | ||
207 | struct iwm_wifi_cmd *iwm_get_pending_wifi_cmd(struct iwm_priv *iwm, u16 seq_num) | 207 | struct iwm_wifi_cmd *iwm_get_pending_wifi_cmd(struct iwm_priv *iwm, u16 seq_num) |
208 | { | 208 | { |
209 | struct iwm_wifi_cmd *cmd, *next; | 209 | struct iwm_wifi_cmd *cmd; |
210 | 210 | ||
211 | list_for_each_entry_safe(cmd, next, &iwm->wifi_pending_cmd, pending) | 211 | list_for_each_entry(cmd, &iwm->wifi_pending_cmd, pending) |
212 | if (cmd->seq_num == seq_num) { | 212 | if (cmd->seq_num == seq_num) { |
213 | list_del(&cmd->pending); | 213 | list_del(&cmd->pending); |
214 | return cmd; | 214 | return cmd; |
@@ -217,12 +217,12 @@ struct iwm_wifi_cmd *iwm_get_pending_wifi_cmd(struct iwm_priv *iwm, u16 seq_num) | |||
217 | return NULL; | 217 | return NULL; |
218 | } | 218 | } |
219 | 219 | ||
220 | struct iwm_nonwifi_cmd * | 220 | struct iwm_nonwifi_cmd *iwm_get_pending_nonwifi_cmd(struct iwm_priv *iwm, |
221 | iwm_get_pending_nonwifi_cmd(struct iwm_priv *iwm, u8 seq_num, u8 cmd_opcode) | 221 | u8 seq_num, u8 cmd_opcode) |
222 | { | 222 | { |
223 | struct iwm_nonwifi_cmd *cmd, *next; | 223 | struct iwm_nonwifi_cmd *cmd; |
224 | 224 | ||
225 | list_for_each_entry_safe(cmd, next, &iwm->nonwifi_pending_cmd, pending) | 225 | list_for_each_entry(cmd, &iwm->nonwifi_pending_cmd, pending) |
226 | if ((cmd->seq_num == seq_num) && | 226 | if ((cmd->seq_num == seq_num) && |
227 | (cmd->udma_cmd.opcode == cmd_opcode) && | 227 | (cmd->udma_cmd.opcode == cmd_opcode) && |
228 | (cmd->resp_received)) { | 228 | (cmd->resp_received)) { |
diff --git a/drivers/net/wireless/iwmc3200wifi/main.c b/drivers/net/wireless/iwmc3200wifi/main.c index 7f34d6dd3c41..90519600a947 100644 --- a/drivers/net/wireless/iwmc3200wifi/main.c +++ b/drivers/net/wireless/iwmc3200wifi/main.c | |||
@@ -423,9 +423,9 @@ int iwm_notif_send(struct iwm_priv *iwm, struct iwm_wifi_cmd *cmd, | |||
423 | static struct iwm_notif *iwm_notif_find(struct iwm_priv *iwm, u32 cmd, | 423 | static struct iwm_notif *iwm_notif_find(struct iwm_priv *iwm, u32 cmd, |
424 | u8 source) | 424 | u8 source) |
425 | { | 425 | { |
426 | struct iwm_notif *notif, *next; | 426 | struct iwm_notif *notif; |
427 | 427 | ||
428 | list_for_each_entry_safe(notif, next, &iwm->pending_notif, pending) { | 428 | list_for_each_entry(notif, &iwm->pending_notif, pending) { |
429 | if ((notif->cmd_id == cmd) && (notif->src == source)) { | 429 | if ((notif->cmd_id == cmd) && (notif->src == source)) { |
430 | list_del(¬if->pending); | 430 | list_del(¬if->pending); |
431 | return notif; | 431 | return notif; |
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c index 36b1580329cc..cbaf8ae3aa37 100644 --- a/drivers/net/wireless/iwmc3200wifi/rx.c +++ b/drivers/net/wireless/iwmc3200wifi/rx.c | |||
@@ -342,12 +342,9 @@ static void iwm_rx_ticket_node_free(struct iwm_rx_ticket_node *ticket_node) | |||
342 | static struct iwm_rx_packet *iwm_rx_packet_get(struct iwm_priv *iwm, u16 id) | 342 | static struct iwm_rx_packet *iwm_rx_packet_get(struct iwm_priv *iwm, u16 id) |
343 | { | 343 | { |
344 | u8 id_hash = IWM_RX_ID_GET_HASH(id); | 344 | u8 id_hash = IWM_RX_ID_GET_HASH(id); |
345 | struct list_head *packet_list; | 345 | struct iwm_rx_packet *packet; |
346 | struct iwm_rx_packet *packet, *next; | ||
347 | |||
348 | packet_list = &iwm->rx_packets[id_hash]; | ||
349 | 346 | ||
350 | list_for_each_entry_safe(packet, next, packet_list, node) | 347 | list_for_each_entry(packet, &iwm->rx_packets[id_hash], node) |
351 | if (packet->id == id) | 348 | if (packet->id == id) |
352 | return packet; | 349 | return packet; |
353 | 350 | ||
@@ -771,7 +768,7 @@ static int iwm_mlme_update_bss_table(struct iwm_priv *iwm, u8 *buf, | |||
771 | (struct iwm_umac_notif_bss_info *)buf; | 768 | (struct iwm_umac_notif_bss_info *)buf; |
772 | struct ieee80211_channel *channel; | 769 | struct ieee80211_channel *channel; |
773 | struct ieee80211_supported_band *band; | 770 | struct ieee80211_supported_band *band; |
774 | struct iwm_bss_info *bss, *next; | 771 | struct iwm_bss_info *bss; |
775 | s32 signal; | 772 | s32 signal; |
776 | int freq; | 773 | int freq; |
777 | u16 frame_len = le16_to_cpu(umac_bss->frame_len); | 774 | u16 frame_len = le16_to_cpu(umac_bss->frame_len); |
@@ -790,7 +787,7 @@ static int iwm_mlme_update_bss_table(struct iwm_priv *iwm, u8 *buf, | |||
790 | IWM_DBG_MLME(iwm, DBG, "\tRSSI: %d\n", umac_bss->rssi); | 787 | IWM_DBG_MLME(iwm, DBG, "\tRSSI: %d\n", umac_bss->rssi); |
791 | IWM_DBG_MLME(iwm, DBG, "\tFrame Length: %d\n", frame_len); | 788 | IWM_DBG_MLME(iwm, DBG, "\tFrame Length: %d\n", frame_len); |
792 | 789 | ||
793 | list_for_each_entry_safe(bss, next, &iwm->bss_list, node) | 790 | list_for_each_entry(bss, &iwm->bss_list, node) |
794 | if (bss->bss->table_idx == umac_bss->table_idx) | 791 | if (bss->bss->table_idx == umac_bss->table_idx) |
795 | break; | 792 | break; |
796 | 793 | ||
@@ -1331,7 +1328,7 @@ static int iwm_rx_handle_nonwifi(struct iwm_priv *iwm, u8 *buf, | |||
1331 | { | 1328 | { |
1332 | u8 seq_num; | 1329 | u8 seq_num; |
1333 | struct iwm_udma_in_hdr *hdr = (struct iwm_udma_in_hdr *)buf; | 1330 | struct iwm_udma_in_hdr *hdr = (struct iwm_udma_in_hdr *)buf; |
1334 | struct iwm_nonwifi_cmd *cmd, *next; | 1331 | struct iwm_nonwifi_cmd *cmd; |
1335 | 1332 | ||
1336 | seq_num = GET_VAL32(hdr->cmd, UDMA_HDI_IN_CMD_NON_WIFI_HW_SEQ_NUM); | 1333 | seq_num = GET_VAL32(hdr->cmd, UDMA_HDI_IN_CMD_NON_WIFI_HW_SEQ_NUM); |
1337 | 1334 | ||
@@ -1343,7 +1340,7 @@ static int iwm_rx_handle_nonwifi(struct iwm_priv *iwm, u8 *buf, | |||
1343 | * That means we only support synchronised non wifi command response | 1340 | * That means we only support synchronised non wifi command response |
1344 | * schemes. | 1341 | * schemes. |
1345 | */ | 1342 | */ |
1346 | list_for_each_entry_safe(cmd, next, &iwm->nonwifi_pending_cmd, pending) | 1343 | list_for_each_entry(cmd, &iwm->nonwifi_pending_cmd, pending) |
1347 | if (cmd->seq_num == seq_num) { | 1344 | if (cmd->seq_num == seq_num) { |
1348 | cmd->resp_received = 1; | 1345 | cmd->resp_received = 1; |
1349 | cmd->buf.len = buf_size; | 1346 | cmd->buf.len = buf_size; |