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: <20250902-vhci-hcd-cleanup-v1-3-1d46247cb234@collabora.com>
Date: Tue, 02 Sep 2025 14:56:25 +0300
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: Valentina Manea <valentina.manea.m@...il.com>, 
 Shuah Khan <shuah@...nel.org>, Hongren Zheng <i@...ithal.me>, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: kernel@...labora.com, linux-usb@...r.kernel.org, 
 linux-kernel@...r.kernel.org
Subject: [PATCH 03/17] usb: vhci-hcd: Avoid unnecessary use of braces

Improve code readability in vhci_urb_dequeue() by getting rid of a pair
of braces and reduce the indentation level of the related code block.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
---
 drivers/usb/usbip/vhci_hcd.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 437c5dd8fa077310f4f15c3dd03cd805650b8999..8b8012440f66f97c34ffc39d1a927b74f035ac91 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -866,6 +866,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 	struct vhci_priv *priv;
 	struct vhci_device *vdev;
 	unsigned long flags;
+	int ret;
 
 	spin_lock_irqsave(&vhci->lock, flags);
 
@@ -877,14 +878,10 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 		return -EIDRM;
 	}
 
-	{
-		int ret = 0;
-
-		ret = usb_hcd_check_unlink_urb(hcd, urb, status);
-		if (ret) {
-			spin_unlock_irqrestore(&vhci->lock, flags);
-			return ret;
-		}
+	ret = usb_hcd_check_unlink_urb(hcd, urb, status);
+	if (ret) {
+		spin_unlock_irqrestore(&vhci->lock, flags);
+		return ret;
 	}
 
 	 /* send unlink request here? */

-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ