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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Oct 2021 14:37:35 +0100
From:   Robert Greener <rob@...greener.com>
To:     unlisted-recipients:; (no To-header on input)
Subject: [PATCH 11/13] usb: core: config: remove unnecessary parentheses

This fixes the following checkpatch.pl warnings:

core/config.c:657: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'header->bLength > size2'
core/config.c:657: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'header->bLength < 2'

Signed-off-by: Robert Greener <rob@...greener.com>
---
 drivers/usb/core/config.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 76038e8c84c5..ab3395ec4260 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -267,8 +267,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
 
 	if (d->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE) {
 		n = USB_DT_ENDPOINT_AUDIO_SIZE;
-	}
-	else if (d->bLength >= USB_DT_ENDPOINT_SIZE) {
+	} else if (d->bLength >= USB_DT_ENDPOINT_SIZE) {
 		n = USB_DT_ENDPOINT_SIZE;
 	} else {
 		dev_warn(ddev,
@@ -655,7 +654,7 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
 		}
 
 		header = (struct usb_descriptor_header *)buffer2;
-		if ((header->bLength > size2) || (header->bLength < 2)) {
+		if (header->bLength > size2 || header->bLength < 2) {
 			dev_warn(ddev,
 				 "config %d has an invalid descriptor of length %d, skipping remainder of the config\n",
 				 cfgno, header->bLength);
-- 
2.32.0

Powered by blists - more mailing lists