lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1432223628-1664-29-git-send-email-mateusz.kulikowski@gmail.com>
Date:	Thu, 21 May 2015 17:53:41 +0200
From:	Mateusz Kulikowski <mateusz.kulikowski@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	Mateusz Kulikowski <mateusz.kulikowski@...il.com>,
	dan.carpenter@...cle.com, joe@...ches.com,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH v4 28/35] staging: rtl8192e: Replace ?: with min_t

Replace :? with min_t for readability. Remove check that is always false.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@...il.com>
---
 drivers/staging/rtl8192e/rtllib_softmac_wx.c | 8 +-------
 drivers/staging/rtl8192e/rtllib_wx.c         | 3 +--
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index d5e13a5..86f52ac7 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -454,13 +454,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee,
 
 	proto_started = ieee->proto_started;
 
-	len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length :
-	       IW_ESSID_MAX_SIZE;
-
-	if (len > IW_ESSID_MAX_SIZE) {
-		ret = -E2BIG;
-		goto out;
-	}
+	len = min_t(__u16, wrqu->essid.length, IW_ESSID_MAX_SIZE);
 
 	if (ieee->iw_mode == IW_MODE_MONITOR) {
 		ret = -1;
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index 2812a77..2ac1617 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -851,8 +851,7 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
 		if ((eid == MFIE_TYPE_GENERIC) && (!memcmp(&ie[2],
 		     wps_oui, 4))) {
 
-			ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len) :
-					   (MAX_WZC_IE_LEN);
+			ieee->wps_ie_len = min_t(size_t, len, MAX_WZC_IE_LEN);
 			buf = kmemdup(ie, ieee->wps_ie_len, GFP_KERNEL);
 			if (buf == NULL)
 				return -ENOMEM;
-- 
1.8.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ