Skip to contentSkip to conversation

iwlegacy: cleanup end of il_send_add_sta()

PATCH Applied Dan Carpenter 3 participants 3 messages Dec 4, 2015 – Dec 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlegacy: cleanup end of il_send_add_sta()

This code causes a static checker warning because we check for "if (ret = 0)" but we have already had verified that was true. Clean it up a little.

---
I have preserved the original behavior but it's possible that the original code was buggy. Please review.

drivers/net/wireless/intel/iwlegacy/common.c +6 -6
index 8871145..e49bad2 100644
@@ -1865,14 +1865,14 @@ il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags)
 
 	cmd.len = il->ops->build_addsta_hcmd(sta, data);
 	ret = il_send_cmd(il, &cmd);
-
-	if (ret || (flags & CMD_ASYNC))
+	if (ret)
 		return ret;
+	if (flags & CMD_ASYNC)
+		return 0;
+
+	pkt = (struct il_rx_pkt *)cmd.reply_page;
+	ret = il_process_add_sta_resp(il, sta, pkt, true);
 
-	if (ret = 0) {
-		pkt = (struct il_rx_pkt *)cmd.reply_page;
-		ret = il_process_add_sta_resp(il, sta, pkt, true);
-	}
 	il_free_pages(il, cmd.reply_page);
 
 	return ret;