From: Dafna Hirschfeld <dafna3@gmail.com>
To: aditya.shankar@microchip.com, ganesh.krishna@microchip.com,
gregkh@linuxfoundation.org
Cc: outreachy-kernel@googlegroups.com
Subject: [PATCH] staging: wilc1000: remove 'if' on field address
Date: Thu, 22 Feb 2018 09:10:12 +0200 [thread overview]
Message-ID: <20180222071009.GA4082@gmail.com> (raw)
Remove 'if' statements testing struct's field address.
Since such statements always return true, they are redundant.
Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
drivers/staging/wilc1000/linux_wlan.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index d9725ef..cf746f2 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -628,8 +628,7 @@ void wilc1000_wlan_deinit(struct net_device *dev)
wl->hif_func->disable_interrupt(wl);
mutex_unlock(&wl->hif_cs);
}
- if (&wl->txq_event)
- complete(&wl->txq_event);
+ complete(&wl->txq_event);
wlan_deinitialize_threads(dev);
deinit_irq(dev);
@@ -677,11 +676,8 @@ static int wlan_deinit_locks(struct net_device *dev)
vif = netdev_priv(dev);
wilc = vif->wilc;
- if (&wilc->hif_cs)
- mutex_destroy(&wilc->hif_cs);
-
- if (&wilc->rxq_cs)
- mutex_destroy(&wilc->rxq_cs);
+ mutex_destroy(&wilc->hif_cs);
+ mutex_destroy(&wilc->rxq_cs);
return 0;
}
@@ -716,8 +712,7 @@ static void wlan_deinitialize_threads(struct net_device *dev)
wl->close = 1;
- if (&wl->txq_event)
- complete(&wl->txq_event);
+ complete(&wl->txq_event);
if (wl->txq_thread) {
kthread_stop(wl->txq_thread);
--
2.7.4
next reply other threads:[~2018-02-22 7:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 7:10 Dafna Hirschfeld [this message]
2018-02-22 8:04 ` [Outreachy kernel] [PATCH] staging: wilc1000: remove 'if' on field address Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180222071009.GA4082@gmail.com \
--to=dafna3@gmail.com \
--cc=aditya.shankar@microchip.com \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.