netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mwifiex: drop condition with no effect
@ 2015-07-08 14:15 Nicholas Mc Guire
       [not found] ` <1436364902-28943-1-git-send-email-hofrat-Q945KHDl0DbYtjvyW6yDsg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-07-08 14:15 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: Avinash Patil, Kalle Valo, linux-wireless, netdev,
	Nicholas Mc Guire

scanning for trivial bug-patters with coccinelle spatches returned:
./drivers/net/wireless/mwifiex/sta_cmdresp.c:895
        WARNING: condition with no effect (if branch == else)

originally added in 'commit d8d2f19feb16 ("mwifiex: silence TDLS link
delete failure for nonexistent link")' with dev_dbg/dev_err (though
with the same message) to differentiate severity and then in 'commit
acebe8c10a6e ("mwifiex: change dbg print func to mwifiex_dbg")' all
dev_dbg,dev_warn and dev_err got converted to mwifiex_dbg which should
thus probably drop this if/else as well.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

If dropping the if/else is not the right thing to do then commit 
acebe8c10a6e "mwifiex: change dbg print func to mwifiex_dbg" probably
needs a review as well.

Patch was compile tested with x86_64_defconfig + CONFIG_MWIFIEX=m

Patch is against 4.2-rc1 (localversion-next is -next-20150708)

 drivers/net/wireless/mwifiex/sta_cmdresp.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index b645884..e58f900 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -892,14 +892,9 @@ static int mwifiex_ret_tdls_oper(struct mwifiex_private *priv,
 	switch (action) {
 	case ACT_TDLS_DELETE:
 		if (reason) {
-			if (!node || reason == TDLS_ERR_LINK_NONEXISTENT)
-				mwifiex_dbg(priv->adapter, ERROR,
-					    "TDLS link delete for %pM failed: reason %d\n",
-					    cmd_tdls_oper->peer_mac, reason);
-			else
-				mwifiex_dbg(priv->adapter, ERROR,
-					    "TDLS link delete for %pM failed: reason %d\n",
-					    cmd_tdls_oper->peer_mac, reason);
+			mwifiex_dbg(priv->adapter, ERROR,
+				    "TDLS link delete for %pM failed: reason %d\n",
+				    cmd_tdls_oper->peer_mac, reason);
 		} else {
 			mwifiex_dbg(priv->adapter, MSG,
 				    "TDLS link delete for %pM successful\n",
-- 
1.7.10.4

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

end of thread, other threads:[~2015-07-09  5:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 14:15 [PATCH] mwifiex: drop condition with no effect Nicholas Mc Guire
     [not found] ` <1436364902-28943-1-git-send-email-hofrat-Q945KHDl0DbYtjvyW6yDsg@public.gmane.org>
2015-07-08 21:55   ` Avinash Patil
     [not found]     ` <CAJwzM1kvWfP1VB4wUoT74F-Ons1R3cpoBEAdfm37sh1p5vhh+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-09  5:57       ` Nicholas Mc Guire

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