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>] [day] [month] [year] [list]
Message-Id: <20240628155103.3585-1-sensor1010@163.com>
Date: Fri, 28 Jun 2024 08:51:02 -0700
From: Lizhe <sensor1010@....com>
To: mathias.nyman@...el.com,
	gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Lizhe <sensor1010@....com>
Subject: [PATCH] usb: xhci: Covert to update_device callback returning void

the returned value is ignored, and to improve this situation,
it is proposed to modify the return type of the xhci_update_device()
callback function to void.

Signed-off-by: Lizhe <sensor1010@....com>
---
 drivers/usb/host/xhci.c | 8 +++-----
 include/linux/usb/hcd.h | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 37eb37b0affa..63db4957d3af 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4507,19 +4507,19 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
 	return 0;
 }
 
-static int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
+static void xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
 {
 	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);
 	struct xhci_port *port;
 	u32 capability;
 
 	if (hcd->speed >= HCD_USB3 || !udev->lpm_capable || !xhci->hw_lpm_support)
-		return 0;
+		return;
 
 	/* we only support lpm for non-hub device connected to root hub yet */
 	if (!udev->parent || udev->parent->parent ||
 			udev->descriptor.bDeviceClass == USB_CLASS_HUB)
-		return 0;
+		return;
 
 	port = xhci->usb2_rhub.ports[udev->portnum - 1];
 	capability = port->port_cap->protocol_caps;
@@ -4531,8 +4531,6 @@ static int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
 		if (capability & XHCI_BLC)
 			udev->usb2_hw_lpm_besl_capable = 1;
 	}
-
-	return 0;
 }
 
 /*---------------------- USB 3.0 Link PM functions ------------------------*/
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index ac95e7c89df5..c3fd1643ff1a 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -386,7 +386,7 @@ struct hc_driver {
 		/* Notifies the HCD after a device is connected and its
 		 * address is set
 		 */
-	int	(*update_device)(struct usb_hcd *, struct usb_device *);
+	void	(*update_device)(struct usb_hcd *, struct usb_device *);
 	int	(*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int);
 	/* USB 3.0 Link Power Management */
 		/* Returns the USB3 hub-encoded value for the U1/U2 timeout. */
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ