Skip to contentSkip to conversation

iwlwifi: remove late null-check and duplicate bug_on

PATCH New Tomas Winkler 1 participant 1 message Oct 15, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

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
index 724a569..d93d169 100644
@@ -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
index cb3a368..a198b01 100644
@@ -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.