Search Linux Wireless

[PATCH 31/35] Simplify logic in at76_is_hidden_ssid()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---

 drivers/net/wireless/at76_usb.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index e612dc5..89eca8d 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -542,9 +542,13 @@ static inline int at76_is_hidden_ssid(u8 *ssid, int length)
 {
 	static const u8 zeros[32];
 
-	return (length == 0) ||
-	    (length == 1 && *ssid == ' ') ||
-	    (length > 0 && !memcmp(ssid, zeros, length));
+	if (length == 0)
+		return 1;
+
+	if (length == 1 && ssid[0] == ' ')
+		return 1;
+
+	return (memcmp(ssid, zeros, length) == 0);
 }
 
 static inline void at76_free_bss_list(struct at76_priv *priv)
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux