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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Apr 2017 15:13:46 +0100
From:   Colin King <colin.king@...onical.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Larry Finger <Larry.Finger@...inger.net>,
        devel@...verdev.osuosl.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8723bs: remove redundant comparisons of unsigned ints with >= 0

From: Colin Ian King <colin.king@...onical.com>

The comparison of mode >= 0 is redundant as mode is a u32 and this
is always true.  Remove this redundant code.

Detected with CoverityScan ("Unsigned compared against 0")

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/staging/rtl8723bs/core/rtw_debug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c
index 51cef55d3f76..fc6b94d59c37 100644
--- a/drivers/staging/rtl8723bs/core/rtw_debug.c
+++ b/drivers/staging/rtl8723bs/core/rtw_debug.c
@@ -1031,7 +1031,7 @@ ssize_t proc_set_ht_enable(struct file *file, const char __user *buffer, size_t
 	if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
 		sscanf(tmp, "%d ", &mode);
 
-		if (pregpriv && mode >= 0 && mode < 2) {
+		if (pregpriv && mode < 2) {
 			pregpriv->ht_enable = mode;
 			printk("ht_enable =%d\n", pregpriv->ht_enable);
 		}
@@ -1150,7 +1150,7 @@ ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t c
 
 		sscanf(tmp, "%d ", &mode);
 
-		if (pregpriv && mode >= 0 && mode < 2) {
+		if (pregpriv && mode < 2) {
 			pmlmeinfo->bAcceptAddbaReq = mode;
 			DBG_871X("pmlmeinfo->bAcceptAddbaReq =%d\n", pmlmeinfo->bAcceptAddbaReq);
 			if (mode == 0) {
@@ -1191,7 +1191,7 @@ ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t co
 	if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
 		sscanf(tmp, "%d ", &mode);
 
-		if (pregpriv && mode >= 0 && mode < 2) {
+		if (pregpriv && mode < 2) {
 			pregpriv->check_fw_ps = mode;
 			DBG_871X("pregpriv->check_fw_ps =%d\n", pregpriv->check_fw_ps);
 		}
-- 
2.11.0

Powered by blists - more mailing lists