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-next>] [day] [month] [year] [list]
Date:   Sat, 6 Jun 2020 17:37:03 +0200
From:   Pavel Machek <pavel@...x.de>
To:     hminas@...opsys.com, gregkh@...uxfoundation.org,
        linux-usb@...r.kernel.org,
        kernel list <linux-kernel@...r.kernel.org>, trivial@...nel.org
Subject: [PATCH] sr: dwc2/gadget: remove unneccessary if

We don't really need if/else to set variable to 1/0.

Signed-off-by: Pavel Machek (CIP) <pavel@...x.de>

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 12b98b466287..f9f6fd470c81 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -1761,10 +1761,7 @@ static int dwc2_hsotg_process_req_feature(struct dwc2_hsotg *hsotg,
 	case USB_RECIP_DEVICE:
 		switch (wValue) {
 		case USB_DEVICE_REMOTE_WAKEUP:
-			if (set)
-				hsotg->remote_wakeup_allowed = 1;
-			else
-				hsotg->remote_wakeup_allowed = 0;
+			hsotg->remote_wakeup_allowed = set;
 			break;
 
 		case USB_DEVICE_TEST_MODE:

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ