linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: do not use assignment in if condition
@ 2018-06-21 18:22 Michael Straube
  2018-06-22 10:40 ` Dan Carpenter
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Straube @ 2018-06-21 18:22 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Fix checkpatch error 'do not use assignment in if condition'.

Signed-off-by: Michael Straube <michael.straube@posteo.de>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e55895632921..87a4ced41028 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1181,9 +1181,8 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
 	     (mac[3] == 0xff) && (mac[4] == 0xff) && (mac[5] == 0xff)) ||
 	    ((mac[0] == 0x00) && (mac[1] == 0x00) && (mac[2] == 0x00) &&
 	     (mac[3] == 0x00) && (mac[4] == 0x00) && (mac[5] == 0x00))) {
-		if (np &&
-		    (addr = of_get_property(np, "local-mac-address", &len)) &&
-		    len == ETH_ALEN) {
+		addr = of_get_property(np, "local-mac-address", &len);
+		if (np && addr && len == ETH_ALEN) {
 			memcpy(mac_addr, addr, ETH_ALEN);
 		} else {
 			mac[0] = 0x00;
-- 
2.17.1


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

end of thread, other threads:[~2018-06-25  9:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 18:22 [PATCH] staging: rtl8723bs: do not use assignment in if condition Michael Straube
2018-06-22 10:40 ` Dan Carpenter
2018-06-22 10:54   ` Joe Perches
2018-06-22 10:57     ` Dan Carpenter
2018-06-22 12:48       ` Michael Straube
2018-06-22 17:28         ` Joe Perches
2018-06-22 19:11           ` Michael Straube
2018-06-23  1:59             ` Joe Perches
2018-06-25  9:49           ` Andy Shevchenko

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