kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iwlegacy: cleanup end of il_send_add_sta()
@ 2015-12-04 13:16 Dan Carpenter
  2015-12-04 15:46 ` Stanislaw Gruszka
  2015-12-11 11:16 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-12-04 13:16 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Kalle Valo, linux-wireless, kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I have preserved the original behavior but it's possible that the
original code was buggy.  Please review.

diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c
index 8871145..e49bad2 100644
--- a/drivers/net/wireless/intel/iwlegacy/common.c
+++ b/drivers/net/wireless/intel/iwlegacy/common.c
@@ -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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] iwlegacy: cleanup end of il_send_add_sta()
  2015-12-04 13:16 [patch] iwlegacy: cleanup end of il_send_add_sta() Dan Carpenter
@ 2015-12-04 15:46 ` Stanislaw Gruszka
  2015-12-11 11:16 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2015-12-04 15:46 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Kalle Valo, linux-wireless, kernel-janitors

On Fri, Dec 04, 2015 at 04:16:45PM +0300, Dan Carpenter wrote:
> 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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: iwlegacy: cleanup end of il_send_add_sta()
  2015-12-04 13:16 [patch] iwlegacy: cleanup end of il_send_add_sta() Dan Carpenter
  2015-12-04 15:46 ` Stanislaw Gruszka
@ 2015-12-11 11:16 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2015-12-11 11:16 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Stanislaw Gruszka, linux-wireless, kernel-janitors


> 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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-11 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 13:16 [patch] iwlegacy: cleanup end of il_send_add_sta() Dan Carpenter
2015-12-04 15:46 ` Stanislaw Gruszka
2015-12-11 11:16 ` Kalle Valo

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).