From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9769D2FAC19; Tue, 2 Sep 2025 11:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814220; cv=none; b=VefYzlgTE86MKgCYoR/0D1fC2bBbrhboRW/m5i2GECf7zz4y3Qw2lIotAjBgyyfqLeJNmicv8oAHIfwtxfFY7vtMV4yds6vtX4ppLNnycR8WUrQX10iQ8liQJ29p0sP+5agGhOK4re3ebpSDXX2vAxBvUOawj1h0mmxrj8oAeTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814220; c=relaxed/simple; bh=G/XUaMfPj7nOSu821gUj7psQyMgYbdlYRDCsutzu018=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aijycCSiGjqZkHnsIoaoeewlFZ9lGFVNA7H8x5zXPwQh/xlelXBvYJ9atBsmyYKzD91F/OOh9So62hLKNli3+U9fzAee2azbYpLhqb/hTTKaha5GhuHDqCiUybpg6HI69Ad8RK8wqwXt7PY0y67kh6QDf3REeW5BaUKRtioRe5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=UiGp3BPE; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="UiGp3BPE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814216; bh=G/XUaMfPj7nOSu821gUj7psQyMgYbdlYRDCsutzu018=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UiGp3BPECSCU2+sKCNNgPYmoSeXyt9QYYPnWZJmig2O1tMAPO7PjZT4WLAgdBMmWd i6xNyrNW2GXIEIX9IL4fl/u1d76igBLmYydA+svgFlSbfmZhQPvWjZKxRaFzpRCkJv Ozu5V3d8+bVu6BSoaHLa4Vh2rtpaDrWRIxipvU+F1Z8m45Og09naN+eRq8iFypnFKf w/fJppCor6Yt3P5v5hXgWNucCEToB/bVaEqkkc4eVVbA0n8jfZQj4LFo8QPkCPk2kl 609Cz7ktMatBo571AGu280l+QgiHuc64w1yahkXd3QPHKP9oJLAHvFWOAt5Aif2qgB ZPn/L4PxY9VKw== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id AFBF817E0C21; Tue, 2 Sep 2025 13:56:56 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:23 +0300 Subject: [PATCH 01/17] usb: vhci-hcd: Ensure lines do not end with '(' Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-1-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Format code to get rid of the checkpatch complaint: CHECK: Lines should not end with a '(' While at it, also remove the leading whitespace from the quoted strings passed as arguments to the affected functions. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 46 +++++++++++++++++-----------------------= ---- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e70fba9f55d6a0edf3c5fde56a614dd3799406a1..764ade343bd4fb9d680f518ead9= 97f6165214214 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -289,8 +289,8 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc) memset(desc, 0, sizeof *desc); desc->bDescriptorType =3D USB_DT_SS_HUB; desc->bDescLength =3D 12; - desc->wHubCharacteristics =3D cpu_to_le16( - HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); + desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | + HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =3D VHCI_HC_PORTS; desc->u.ss.bHubHdrDecLat =3D 0x04; /* Worst case: 0.4 micro sec*/ desc->u.ss.DeviceRemovable =3D 0xffff; @@ -302,9 +302,8 @@ static inline void hub_descriptor(struct usb_hub_descri= ptor *desc) =20 memset(desc, 0, sizeof(*desc)); desc->bDescriptorType =3D USB_DT_HUB; - desc->wHubCharacteristics =3D cpu_to_le16( - HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_COMMON_OCPM); - + desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | + HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =3D VHCI_HC_PORTS; BUILD_BUG_ON(VHCI_HC_PORTS > USB_MAXCHILDREN); width =3D desc->bNbrPorts / 8 + 1; @@ -378,8 +377,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, "supported for USB 3.0 roothub\n"); goto error; } - usbip_dbg_vhci_rh( - " ClearPortFeature: USB_PORT_FEAT_SUSPEND\n"); + + usbip_dbg_vhci_rh("ClearPortFeature: USB_PORT_FEAT_SUSPEND\n"); if (vhci_hcd->port_status[rhport] & USB_PORT_STAT_SUSPEND) { /* 20msec signaling */ vhci_hcd->resuming =3D 1; @@ -387,8 +386,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } break; case USB_PORT_FEAT_POWER: - usbip_dbg_vhci_rh( - " ClearPortFeature: USB_PORT_FEAT_POWER\n"); + usbip_dbg_vhci_rh("ClearPortFeature: USB_PORT_FEAT_POWER\n"); if (hcd->speed >=3D HCD_USB3) vhci_hcd->port_status[rhport] &=3D ~USB_SS_PORT_STAT_POWER; else @@ -464,10 +462,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 t= ypeReq, u16 wValue, VDEV_ST_NOTASSIGNED || vhci_hcd->vdev[rhport].ud.status =3D=3D VDEV_ST_USED) { - usbip_dbg_vhci_rh( - " enable rhport %d (status %u)\n", - rhport, - vhci_hcd->vdev[rhport].ud.status); + usbip_dbg_vhci_rh("enable rhport %d (status %u)\n", + rhport, + vhci_hcd->vdev[rhport].ud.status); vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_ENABLE; } @@ -502,8 +499,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case SetPortFeature: switch (wValue) { case USB_PORT_FEAT_LINK_STATE: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_LINK_STATE req not " "supported for USB 2.0 roothub\n"); @@ -515,12 +511,10 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, */ break; case USB_PORT_FEAT_U1_TIMEOUT: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_U1_TIMEOUT\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_U1_TIMEOUT\n"); fallthrough; case USB_PORT_FEAT_U2_TIMEOUT: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); /* TODO: add suspend/resume support! */ if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_U1/2_TIMEOUT req not " @@ -529,8 +523,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } break; case USB_PORT_FEAT_SUSPEND: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); /* Applicable only for USB2.0 hub */ if (hcd->speed >=3D HCD_USB3) { pr_err("USB_PORT_FEAT_SUSPEND req not " @@ -546,8 +539,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_SUSPEND; break; case USB_PORT_FEAT_POWER: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_POWER\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_POWER\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; @@ -558,8 +550,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, vhci_hcd->port_status[rhport] |=3D USB_PORT_STAT_POWER; break; case USB_PORT_FEAT_BH_PORT_RESET: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; @@ -572,8 +563,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } fallthrough; case USB_PORT_FEAT_RESET: - usbip_dbg_vhci_rh( - " SetPortFeature: USB_PORT_FEAT_RESET\n"); + usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_RESET\n"); if (invalid_rhport) { pr_err("invalid port number %d\n", wIndex); goto error; @@ -781,7 +771,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag =20 case USB_REQ_GET_DESCRIPTOR: if (ctrlreq->wValue =3D=3D cpu_to_le16(USB_DT_DEVICE << 8)) - usbip_dbg_vhci_hc( + usbip_dbg_vhci_hc(/**/ "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); =20 vdev->udev =3D usb_get_dev(urb->dev); --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61FEB2FABF0; Tue, 2 Sep 2025 11:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814221; cv=none; b=IWZIvs9o2nlXPAvm/vCyoln+FrmLxEjqFH/YRhHNzjS+EgYJ3rWfR+aHS7c36Ij5gzGCYJ9Y2A+2lSz/uXKF22H0t4m/zZHwegY+65Uv6DNrKRAors6RS4AkMFPOrE10nwhZSbor19LmJBIfEvY5NCoOI+o0vqmWctpFLzw52Sk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814221; c=relaxed/simple; bh=QnjGonsDqZPGnZZkeE224zwZkLc85sQkNvz+zjv8Pp8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HefrP5r6yXMaLeuddgxMOv7hga+VIfacKCz2x1IdpJHRkv5LP7TEs8XmC8YkhvX157sW4/AFTH9UovkPR+Ts6i/XSZdFBP28bbcv2SnWQ3RzN03NrPQtNnFC5jctEnDW8xKAMiKugESlj5saXrMJaMLJmcgBfUvFb68+8Q3VwKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=afy43oVa; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="afy43oVa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814217; bh=QnjGonsDqZPGnZZkeE224zwZkLc85sQkNvz+zjv8Pp8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=afy43oVarvQjEMo5QKKKvMwP6MmtDSFAfU9hRWlSE9UlAls0gEvEjWAuJh7FU3G5U 71Hu4o8JnOzo1Z+ohzkU168N2oqChq1AD4ub+cgidBwoa3a110qzs6X1poafdpYiMr KFwh0S6bKl8U35EIqv+/LbpBwdKx8vNlcjXKead8FIc3PX0mJIgRIBV0UBNifgcaLh gGqb2NxfaxGv3SfDDW8aMn3FzEsPXHfsNdTAU4btjC/cv0XM6fdnPC0H+OwsNTnxlj OfV6a2ybNTd10AboJIkcpbuQjaED6NIVzRrKLfQBcBnQTLvac2BMzOjOFpSlO8zz6X CWFuSIRtHtOQg== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 83E7617E10B7; Tue, 2 Sep 2025 13:56:57 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:24 +0300 Subject: [PATCH 02/17] usb: vhci-hcd: Consistently use the braces Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-2-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Fix the inconsistent usage of braces as reported by checkpatch: CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 764ade343bd4fb9d680f518ead997f6165214214..437c5dd8fa077310f4f15c3dd03= cd805650b8999 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -346,8 +346,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, invalid_rhport =3D true; if (wIndex > VHCI_HC_PORTS) pr_err("invalid port number %d\n", wIndex); - } else + } else { rhport =3D wIndex - 1; + } =20 vhci_hcd =3D hcd_to_vhci_hcd(hcd); vhci =3D vhci_hcd->vhci; @@ -598,11 +599,12 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 = typeReq, u16 wValue, USB_SS_PORT_STAT_POWER) !=3D 0) { vhci_hcd->port_status[rhport] |=3D (1 << wValue); } - } else + } else { if ((vhci_hcd->port_status[rhport] & USB_PORT_STAT_POWER) !=3D 0) { vhci_hcd->port_status[rhport] |=3D (1 << wValue); } + } } break; case GetPortErrorCount: --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3661D2FB606; Tue, 2 Sep 2025 11:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814222; cv=none; b=UGNLDUXCTgsmX80IQPLKT0n/zHQUiGQzkXKvU2nDyOd4RxCyNlSW+GHIle9TAykLkQtpPVI3RdHhuvQrvM+tJGLT+EmToN3jCu3ZQYFaNusWqs1dhXBNJFYw+oQi3pm/tcJV9yTqxcTmL1rOf3ye+372gkKRyHtd2TbUVwPBhqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814222; c=relaxed/simple; bh=p1j/i1v/ceR/URuKkUpQWpeEdhLRvrZUbhrXCAgxohU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZhAQEXwVJHb5TAyhz0iC02LGUl2vEIYyoCKDD1XP02by6Wa/L0uSoLWLBxlFfVg20FVoVfILkKNxhjj7Wo03u2ykGwiaE/xbBGD1Zk5HG9VYs4H3ERaVpjOwWZ5tnvNWneU/Wqd8DhvnYjRX1MLGkViMiIXwK+Sjo9+KbSO+G0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hQdtxZFy; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hQdtxZFy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814218; bh=p1j/i1v/ceR/URuKkUpQWpeEdhLRvrZUbhrXCAgxohU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hQdtxZFyKliE3b8+Yd9SdENhZ2kNKtO21DxLV3hWSdTM9aCIYPXB/DAIxG2ofsD/q ysIHRuOHqoSByRnN7X1gSpOA9HbXkXJb3IIgA3QqjJz0uLmmdfSVzyb9v+B5lB3iHZ T+IyvpQRAhFQDN/dRlDARNvJCk45b2K5BFhCT1KnIb9gMcF0cbb6c30KPE5+CzDB9+ JHOjJGDW8fP5LrsuivLXOiSeYvFYQJ6RTpaqYD3ac8j/nJ1K8/vWhcv/Hvrx/A2v7B OtslyoVYbcfxjxKHJgOoeIRP5sNZWm+uf/KTH3rEqxKQ+cXSDu6iu4lIWyOjhZZh1t iQIC8hrzS/1Dw== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 6028E17E131D; Tue, 2 Sep 2025 13:56:58 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:25 +0300 Subject: [PATCH 03/17] usb: vhci-hcd: Avoid unnecessary use of braces Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-3-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 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 --- 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..8b8012440f66f97c34ffc39d1a9= 27b74f035ac91 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; =20 spin_lock_irqsave(&vhci->lock, flags); =20 @@ -877,14 +878,10 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, stru= ct urb *urb, int status) return -EIDRM; } =20 - { - int ret =3D 0; - - ret =3D usb_hcd_check_unlink_urb(hcd, urb, status); - if (ret) { - spin_unlock_irqrestore(&vhci->lock, flags); - return ret; - } + ret =3D usb_hcd_check_unlink_urb(hcd, urb, status); + if (ret) { + spin_unlock_irqrestore(&vhci->lock, flags); + return ret; } =20 /* send unlink request here? */ --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E5EF2FB63B; Tue, 2 Sep 2025 11:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814223; cv=none; b=Nq30TNEMnol6891lzBU4YOPQZI1NS5iVSxkV5gM0i+vSFQctoBR/bizFEe/HNe9sIgEPyBLCLg7LBq2YNk2Lk4AwrRv+oa/ihryVU4M5ximkTJz+WEahAVGlW02rKYUpmXO2PNNYY0b5+nbvOvOIOF99lPAJW2MnrDLR9XpdNf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814223; c=relaxed/simple; bh=glTRrjp+/FRRCOkugN8uzqNZNuDKxREHCpq1x3UrJZg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r3uP//hwB/2u3d6WmvHYXUOC9RG5Qw4vUDGJbBFVn2Q8YzPYS+nwph+j0uowB6MQkIQet1OVXNQHTkzQF4qP9B2jq7pu0D5+/LXxcIG0e78X69oVTJhBtqtUr6845co0Vw1Mqd8YYL4/PV2ezJlbCRsT+C5AKLXczhqVUjlG41o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=AQmGgcJ5; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="AQmGgcJ5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814219; bh=glTRrjp+/FRRCOkugN8uzqNZNuDKxREHCpq1x3UrJZg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AQmGgcJ5OOFlFQaJRgmACxdfmi8b9gVoTJ/MWVpv9KiABrtqkRc3qvFtMm+SG1lbu b6nToApUYjRqVi/CJJxR3Dz56lCqH3uD2Eq4XMNPgTm3DXrvpciAhV+9GviWN6OsD3 7qZpLR2SXcY6EcKGk6kL8OHD7XlivGyDgC80Tz2PCPOl/POzWDrl4nPq1qICJHrqwx R3qwaQSuQz/GhQzKgb7ypo1v7zyOIoq6grlCWl3qoZMZ6MzMz5NG1AkxFbizEO7xd9 g4KG3idQ/RaR6cOsT4aMWCCzGZLmlaHRBqVFVu1mHBBZLp9j+5I2FHb2z2FpsKK0FU IunMFL6WIFVzA== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 3D8AC17E1333; Tue, 2 Sep 2025 13:56:59 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:26 +0300 Subject: [PATCH 04/17] usb: vhci-hcd: Consistently use blank lines Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-4-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Add blank lines where it helps improve code readability and drop those which are really not required, as indicated by checkpatch: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 8b8012440f66f97c34ffc39d1a927b74f035ac91..59478e8f6c97ac4dad0aaa887df= 3d169c13aee27 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -145,6 +145,7 @@ static void dump_port_status_diff(u32 prev_status, u32 = new_status, bool usb3) if (bit =3D=3D 1) /* USB_PORT_STAT_CONNECTION */ pr_debug(" %c%s\n", change, "USB_PORT_STAT_SPEED_5GBPS"); } + bit <<=3D 1; i++; } @@ -267,7 +268,6 @@ static struct { struct usb_bos_descriptor bos; struct usb_ss_cap_descriptor ss_cap; } __packed usb3_bos_desc =3D { - .bos =3D { .bLength =3D USB_DT_BOS_SIZE, .bDescriptorType =3D USB_DT_BOS, @@ -306,6 +306,7 @@ static inline void hub_descriptor(struct usb_hub_descri= ptor *desc) HUB_CHAR_COMMON_OCPM); desc->bNbrPorts =3D VHCI_HC_PORTS; BUILD_BUG_ON(VHCI_HC_PORTS > USB_MAXCHILDREN); + width =3D desc->bNbrPorts / 8 + 1; desc->bDescLength =3D USB_DT_HUB_NONVAR_SIZE + 2 * width; memset(&desc->u.hs.DeviceRemovable[0], 0, width); @@ -371,6 +372,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + switch (wValue) { case USB_PORT_FEAT_SUSPEND: if (hcd->speed >=3D HCD_USB3) { @@ -398,6 +400,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, wValue); if (wValue >=3D 32) goto error; + vhci_hcd->port_status[rhport] &=3D ~(1 << wValue); break; } @@ -410,6 +413,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("Wrong hub descriptor type for USB 3.0 roothub.\n"); goto error; } + if (hcd->speed >=3D HCD_USB3) ss_hub_descriptor((struct usb_hub_descriptor *) buf); else @@ -506,6 +510,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, "supported for USB 2.0 roothub\n"); goto error; } + /* * Since this is dummy we don't have an actual link so * there is nothing to do for the SET_LINK_STATE cmd @@ -545,6 +550,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + if (hcd->speed >=3D HCD_USB3) vhci_hcd->port_status[rhport] |=3D USB_SS_PORT_STAT_POWER; else @@ -556,6 +562,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + /* Applicable only for USB3.0 hub */ if (hcd->speed < HCD_USB3) { pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " @@ -569,6 +576,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + /* if it's already enabled, disable */ if (hcd->speed >=3D HCD_USB3) { vhci_hcd->port_status[rhport] =3D 0; @@ -592,8 +600,10 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 t= ypeReq, u16 wValue, pr_err("invalid port number %d\n", wIndex); goto error; } + if (wValue >=3D 32) goto error; + if (hcd->speed >=3D HCD_USB3) { if ((vhci_hcd->port_status[rhport] & USB_SS_PORT_STAT_POWER) !=3D 0) { @@ -722,6 +732,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag spin_unlock_irqrestore(&vhci->lock, flags); return -ENODEV; } + spin_unlock(&vdev->ud.lock); =20 ret =3D usb_hcd_link_urb_to_ep(hcd, urb); @@ -789,7 +800,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag ret =3D -EINVAL; goto no_need_xmit; } - } =20 out: @@ -810,6 +820,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag usb_hcd_giveback_urb(hcd, urb, urb->status); local_irq_enable(); } + return ret; } =20 @@ -1200,12 +1211,14 @@ static int vhci_start(struct usb_hcd *hcd) dev_err(hcd_dev(hcd), "init attr group failed, err =3D %d\n", err); return err; } + err =3D sysfs_create_group(&hcd_dev(hcd)->kobj, &vhci_attr_group); if (err) { dev_err(hcd_dev(hcd), "create sysfs files failed, err =3D %d\n", err); vhci_finish_attr_group(); return err; } + pr_info("created sysfs %s\n", hcd_name(hcd)); } =20 @@ -1267,10 +1280,12 @@ static int vhci_bus_resume(struct usb_hcd *hcd) dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); =20 spin_lock_irqsave(&vhci->lock, flags); + if (!HCD_HW_ACCESSIBLE(hcd)) rc =3D -ESHUTDOWN; else hcd->state =3D HC_STATE_RUNNING; + spin_unlock_irqrestore(&vhci->lock, flags); =20 return rc; @@ -1343,6 +1358,7 @@ static int vhci_hcd_probe(struct platform_device *pde= v) pr_err("create primary hcd failed\n"); return -ENOMEM; } + hcd_hs->has_tt =3D 1; =20 /* @@ -1458,6 +1474,7 @@ static int vhci_hcd_resume(struct platform_device *pd= ev) hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); usb_hcd_poll_rh_status(hcd); =20 @@ -1489,6 +1506,7 @@ static void del_platform_devices(void) platform_device_unregister(vhcis[i].pdev); vhcis[i].pdev =3D NULL; } + sysfs_remove_link(&platform_bus.kobj, driver_name); } =20 --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C413B2FC00B; Tue, 2 Sep 2025 11:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814223; cv=none; b=on3fhYeyIjyapAiDXfHdmxG6i+S3jOtq6bpqjZ5FqqoYVLjCYwRwvZlU2YhnrhuObhiqsyly9QSOYocrAmImiXcQFmQdaGgzuJF+5H8h5JB/htIPKxWpkfCoBxspSB6sPjrAbsCZKHerE+inD0FTLmrBBnf0OjDi+sZ7NKHLTAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814223; c=relaxed/simple; bh=x5ipybr/+/KsTjdHoTSzeA2id0uPKxF/Gvr5zbwV6ZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FUfZQgTMckG76MnsPB3W1E+MQJcAPnPywSUGMhL2ixZGr6KDsIy4hMyoX1cmzqHmmDdWukZKSxuevwxtX2WmjNUBGGcU8Do50C/qCEmWlxWc6+rd7H/6objWEItwXk/6WTKO7nxNHAoiYXAjNARm+a1xUE9srgLEWW0kj3WqNoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=GeMDQPCD; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="GeMDQPCD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814220; bh=x5ipybr/+/KsTjdHoTSzeA2id0uPKxF/Gvr5zbwV6ZQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GeMDQPCDvUO61cV8KXB2kCydMJJ4acwj+kLbNRfwZyUz8+6HwqVmS709IxMuB+87p zMiRtC5KR4PhFxQLu7/GQG6e+O439qe+/1znQ5OQ6u4nC7xFWE0ChFYRGQTC2dBKwS 3VispfG7qKMNcYwpMWM7YyUVMcsIs4nBaplFawEdXlJZCV+Kkon93XNLVoUx1XXrnb vkMm3Fy4w8fqLXPhT4cj1AAHi2VM3i41GWL813DI1+YHprmawMhp9Y6hGaAsmvsp9y HTnjq67PxqaDNGCVmZCmSEn2tGk6OVngf6qx9C84pggpS+/gtjLQMIKOD8xWbNO4V+ wetcDukmOWJ8g== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 0842E17E1353; Tue, 2 Sep 2025 13:57:00 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:27 +0300 Subject: [PATCH 05/17] usb: vhci-hcd: Drop spaces after casts Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-5-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Fix a bunch of checkpatch reports: CHECK: No space is necessary after a cast Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 59478e8f6c97ac4dad0aaa887df3d169c13aee27..df25ac939a2273571391562227d= 5c1628a6377e2 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -415,9 +415,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 if (hcd->speed >=3D HCD_USB3) - ss_hub_descriptor((struct usb_hub_descriptor *) buf); + ss_hub_descriptor((struct usb_hub_descriptor *)buf); else - hub_descriptor((struct usb_hub_descriptor *) buf); + hub_descriptor((struct usb_hub_descriptor *)buf); break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR: if (hcd->speed < HCD_USB3) @@ -431,7 +431,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, break; case GetHubStatus: usbip_dbg_vhci_rh(" GetHubStatus\n"); - *(__le32 *) buf =3D cpu_to_le32(0); + *(__le32 *)buf =3D cpu_to_le32(0); break; case GetPortStatus: usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); @@ -490,8 +490,9 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } } } - ((__le16 *) buf)[0] =3D cpu_to_le16(vhci_hcd->port_status[rhport]); - ((__le16 *) buf)[1] =3D + + ((__le16 *)buf)[0] =3D cpu_to_le16(vhci_hcd->port_status[rhport]); + ((__le16 *)buf)[1] =3D cpu_to_le16(vhci_hcd->port_status[rhport] >> 16); =20 usbip_dbg_vhci_rh(" GetPortStatus bye %x %x\n", ((u16 *)buf)[0], @@ -625,7 +626,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, goto error; } /* We'll always return 0 since this is a dummy hub */ - *(__le32 *) buf =3D cpu_to_le32(0); + *(__le32 *)buf =3D cpu_to_le32(0); break; case SetHubDepth: usbip_dbg_vhci_rh(" SetHubDepth\n"); @@ -685,7 +686,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_de= vice *vdev) priv->vdev =3D vdev; priv->urb =3D urb; =20 - urb->hcpriv =3D (void *) priv; + urb->hcpriv =3D (void *)priv; =20 list_add_tail(&priv->list, &vdev->priv_tx); =20 @@ -752,7 +753,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag struct usb_device *old; __u8 type =3D usb_pipetype(urb->pipe); struct usb_ctrlrequest *ctrlreq =3D - (struct usb_ctrlrequest *) urb->setup_packet; + (struct usb_ctrlrequest *)urb->setup_packet; =20 if (type !=3D PIPE_CONTROL || !ctrlreq) { dev_err(dev, "invalid request to devnum 0\n"); --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5BD32FC867; Tue, 2 Sep 2025 11:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814224; cv=none; b=nMVVSYwigUEmiwAjMbi/UbelBw4seDFUZyafpzRO9GPd2PdSVVVzsdKZV1Fpkp0fNWnX7zRgZoDwPtApRMH5agDPNPEb5Mw6lBwxUOvYjaZ7KU6LsVfbfDgNIE3HiW8Rq4CP2yMQjDQADDdg7lP/JpeEGBWXY3OUWR3dc7iLmTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814224; c=relaxed/simple; bh=BpGRJ2nCOdBOHfK+HkfFWIB8NLGRzCDpfAqVeifYDvE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WnsI4/nSOaVJWKELh+FxBMtNFsCd9FGRSAsCEoJC9hMgR4EURq7ioS7qMO1xhxszNHnBZ7RVm2+4a8sW9CcZO5Y8RQHXq/7yw0EQgtUpTPGFdO0sOMP1IDMOsI/nWWwCxSVfCKvZv1wPR/MBZFObyMppIFqdwxHjbs14sYdEFoU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=fgpXocFG; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fgpXocFG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814221; bh=BpGRJ2nCOdBOHfK+HkfFWIB8NLGRzCDpfAqVeifYDvE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fgpXocFGq3xxaq728YI5M/nrWM42dcTa7TWDYPahKoIax7Gmgm6lCJJEfA0cLYx/N gjvzDnaQTohHycyY7WMOeuJuf1sxEtRQ6GfHxNWoFqowFG5ewLvat9xOpGRuwxyIKP KQOFyU8qaG9trROXSySqS8b9dWlM8/nFnPNcIhthcI0LcI8hd2ylTjTYPPQ2HEHCot NCzLZsTUlfRhwYAXRMywH7IR2tSKkBbz9Q23VrqN9BwpKmh58nFatbgCyiqnnz7k7O UScEreG6nR/hOk/w3iVwsFUWpCgqeiDENNEGPswPQMOuVI0gKUypJ2bJ2Nq1JUVlRD lZ3BoT9+FEbjQ== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id DD68117E1354; Tue, 2 Sep 2025 13:57:00 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:28 +0300 Subject: [PATCH 06/17] usb: vhci-hcd: Add spaces around operators Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-6-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Fix a couple of checkpatch reports: CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index df25ac939a2273571391562227d5c1628a6377e2..1b442bc564ed26185d172daa32c= abd1a3f50f322 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -708,7 +708,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag pr_err("invalid port number %d\n", portnum); return -ENODEV; } - vdev =3D &vhci_hcd->vdev[portnum-1]; + vdev =3D &vhci_hcd->vdev[portnum - 1]; =20 if (!urb->transfer_buffer && !urb->num_sgs && urb->transfer_buffer_length) { @@ -1135,7 +1135,7 @@ static int hcd_name_to_id(const char *name) if (c =3D=3D NULL) return 0; =20 - ret =3D kstrtol(c+1, 10, &val); + ret =3D kstrtol(c + 1, 10, &val); if (ret < 0) return ret; =20 --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99C782FDC2C; Tue, 2 Sep 2025 11:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814225; cv=none; b=AARzw+rqgSJQFWfQu0fHwqdwjdEfY6h4dPGhQqbaqxhV+orjRiZngDan6kTUysgg+qquFj95mjmEGYD2JwMA5/B5uZGeZFIJJUPjZxRpYM2gwqF/MGklJ9+mhv+5p9NwgC2n7DoLRLX09rZsdl8g3Y2yvBt8vYTF/p2xf2inVYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814225; c=relaxed/simple; bh=MeTl2vnqx/HjYTc7li0f2XXZ1JdxQPNtDFtKvAwjYCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bSYbrUvxg3culnWw3+A3HSDz8U4ogNoS3FrSi3wERgfBUKrv6LXR/XPzFhWxRpKtGkgLmcNbo2wiFymKEDQqee8qr+q5q4dr346BiwmUyS9AC+tqWCfTQQlSJ7gXLL5gT6x4ROER1lhTlsrCNY1Ca+oi82lsMSZXEWcIbRHygSA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=oyljJy3L; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="oyljJy3L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814222; bh=MeTl2vnqx/HjYTc7li0f2XXZ1JdxQPNtDFtKvAwjYCk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=oyljJy3LQQGdu1WUfKtrdk1mk1vKAh7j59i6+dM4L4FOvnB1GadBbV6otZTBDxqJO GpRf4bx4qZybSeIFh+vBhneDw3Iv0GBZ00cxrVfkwKkdQwilmZicvvyQ/gu6WNKkqR 7ZEOPs2cvOBT/AnovG02jD59YdFlHswLmikJTEmRcAMG6anbpK68yMqCo4hJACnbz8 bEIb/tNqKtjT7SByly2EcnhOXFxi35nkHheoTViK5ETQOBVvRiRz7igyZXMld9KxAH Md2UyDaCUfNDi5HZgFkxZGpUG6W+Rt4TJmduFLdgDszb8K1dvp79BT9BeE7Kv/AC/O oL7lwGQYdeHkQ== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id C6F3717E1355; Tue, 2 Sep 2025 13:57:01 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:29 +0300 Subject: [PATCH 07/17] usb: vhci-hcd: Drop unnecessary parentheses Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-7-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Fix a checkpatch complaint: CHECK: Unnecessary parentheses around Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 1b442bc564ed26185d172daa32cabd1a3f50f322..4ddf7972490d115620f180aa7d4= c9bf09e2aaae7 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -255,7 +255,7 @@ static int vhci_hub_status(struct usb_hcd *hcd, char *b= uf) } } =20 - if ((hcd->state =3D=3D HC_STATE_SUSPENDED) && (changed =3D=3D 1)) + if (hcd->state =3D=3D HC_STATE_SUSPENDED && changed =3D=3D 1) usb_hcd_resume_root_hub(hcd); =20 done: --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D9542FABF0; Tue, 2 Sep 2025 11:57:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814226; cv=none; b=ZozaY/GrAdTnqZQMaDwYCxXnXuJ20ol2i3y2X7RFiX1EgqGPmtkvZQesNgPZ+DjQJNQtPJw+jBvr97NEB9m42estcC+01H8tAcdmsxGtP/S0Bm82bZRO3Ukeb/wH9ZlC3ZfMuxUSIu24SmXHE8ltzZ4/hMY63BZRKakWmIxq1sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814226; c=relaxed/simple; bh=eO6DXUp+7fqvHDto63oXo6Aw4m2d1kYsvTgupSq4tNE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=joiX4UJNqP0LD1eTTv4yk9zJi4MvW8a9B56xtJhpheqFQxCZxWmLoMQpHgSaTDW2yg87QFUDD7/dLL+0v8/QOcnSxzn5fDc4KLfHCjaYyQ9y2tBlfe1C16A1F7zOba6Vp1MT1ekNwcuQ8DEqZw9rxhWYqQyh4zzyVgHnvV3rg88= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=USOqyiMq; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="USOqyiMq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814222; bh=eO6DXUp+7fqvHDto63oXo6Aw4m2d1kYsvTgupSq4tNE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=USOqyiMqdncciLpJ5iuvUQfyZ+sJuyzqjXaSIIx3ADXORv+5g6UY62x8bvKMIHk0P 4ZrojD7roVSmfeFu3JEy2KMv10OGpoR+KNI5ka+o4D53sRdGmyFteT2OlB5JIRyatV td2xoPD6kc8R02lKJ8VUeKSYFxtgj39uWAbqYyiv+fhGSc20b8TmrUwFgTSAdMmj3x zbF8ZtX8i3pab287wPlUvQ1PolK0KpONNArDJKKOtqdcOM7iiXQk+AGnNty2B8jY4q 9xmA4Dz5HRXXqhp9PpwnQH0Lj5zUWPRgm7nHTg/cl8RPShc1H0h7+Vx93o0CtMFLy8 0f/HAKuiqKc5A== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 9E4A217E10B7; Tue, 2 Sep 2025 13:57:02 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:30 +0300 Subject: [PATCH 08/17] usb: vhci-hcd: Fix open parenthesis alignment Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-8-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Address a bunch of checkpatch complaints: CHECK: Alignment should match open parenthesis Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 4ddf7972490d115620f180aa7d4c9bf09e2aaae7..d3933979689f8cd141b3554e902= c1e7b9fc6c694 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -360,7 +360,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, if (usbip_dbg_flag_vhci_rh) { if (!invalid_rhport) memcpy(prev_port_status, vhci_hcd->port_status, - sizeof(prev_port_status)); + sizeof(prev_port_status)); } =20 switch (typeReq) { @@ -408,8 +408,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case GetHubDescriptor: usbip_dbg_vhci_rh(" GetHubDescriptor\n"); if (hcd->speed >=3D HCD_USB3 && - (wLength < USB_DT_SS_HUB_SIZE || - wValue !=3D (USB_DT_SS_HUB << 8))) { + (wLength < USB_DT_SS_HUB_SIZE || wValue !=3D (USB_DT_SS_HUB << 8))) { pr_err("Wrong hub descriptor type for USB 3.0 roothub.\n"); goto error; } @@ -711,7 +710,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag vdev =3D &vhci_hcd->vdev[portnum - 1]; =20 if (!urb->transfer_buffer && !urb->num_sgs && - urb->transfer_buffer_length) { + urb->transfer_buffer_length) { dev_dbg(dev, "Null URB transfer buffer\n"); return -EINVAL; } @@ -956,7 +955,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) } =20 static void vhci_cleanup_unlink_list(struct vhci_device *vdev, - struct list_head *unlink_list) + struct list_head *unlink_list) { struct vhci_hcd *vhci_hcd =3D vdev_to_vhci_hcd(vdev); struct usb_hcd *hcd =3D vhci_hcd_to_hcd(vhci_hcd); @@ -1300,8 +1299,8 @@ static int vhci_bus_resume(struct usb_hcd *hcd) =20 /* Change a group of bulk endpoints to support multiple stream IDs */ static int vhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint **eps, unsigned int num_eps, - unsigned int num_streams, gfp_t mem_flags) + struct usb_host_endpoint **eps, unsigned int num_eps, + unsigned int num_streams, gfp_t mem_flags) { dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n"); return 0; @@ -1309,8 +1308,8 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, st= ruct usb_device *udev, =20 /* Reverts a group of bulk endpoints back to not using stream IDs. */ static int vhci_free_streams(struct usb_hcd *hcd, struct usb_device *udev, - struct usb_host_endpoint **eps, unsigned int num_eps, - gfp_t mem_flags) + struct usb_host_endpoint **eps, unsigned int num_eps, + gfp_t mem_flags) { dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n"); return 0; --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ED882FF14C; Tue, 2 Sep 2025 11:57:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814227; cv=none; b=AywhVdMFvxs7bPgUhLfrF2jcYN1eRWG9GsKAPMIjFQy/OsgAnDNPN0oryj1SBKkccxFhjzUiT/oTZ1qifNSCH8rangb3PGW+LOROGD3u+d0fyraADHZpgFk/LZca9RChc7I4yf1oNmo5kg00iH8gcK+jmg8uQTlM3/qbCcmqQEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814227; c=relaxed/simple; bh=yA3LP5QVmcRjbpMbX945mpkBfWjMxWHDASdt5Mk5ZmQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l4Z/7nQP80ed+iQlCNnFaLNa449H3sIAhUqFL17C+tQuH43CJseSSdggcQ2CAkRA6VNdWcIoUF5pJ15lDV9ijcaeJydB1HjmLP68Gm/8sudB/OXtKuQ086E779aXaNFgQM4nzSlx5GDr/hTzV+XLLsID6+jEl4PF4K7hhM4pkz0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=EX4AsSg4; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="EX4AsSg4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814223; bh=yA3LP5QVmcRjbpMbX945mpkBfWjMxWHDASdt5Mk5ZmQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EX4AsSg4ekc/PPJKfjR+l3Gwd3L+Cgy7X6wP2qCxliI7wYnr5pOHWzHd++z74qUNF 6mKTfy2t42HDEYvTU+oRj/DEuznvAdg+H3MVluuLl7dBx8N49HRBhu5aoLaeYJv5Hi jeiHPYQVMiDAKMR0FNx2UxMHQuhvyERJ5Pkf3e6ZYj/uQPd7rbUc3opA4/hMq1/pTR zAi+RYI9x1Pw9pMCzlawfeBlexXbeU7xoXaSYSkyGES2jsF+GcFGMANjXGEiB5I5DP QCCksOTNKUwbe8xHLffxXTkFAsW4siZH1D0ejOwQWm/2EmKQdqQW16E9nVzcg16Mxx ADa3fWtqOy3zA== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 6913217E0B84; Tue, 2 Sep 2025 13:57:03 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:31 +0300 Subject: [PATCH 09/17] usb: vhci-hcd: Simplify NULL comparison Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-9-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Use the shorter variants as suggested by checkpatch.pl: CHECK: Comparison to NULL could be written "!c" CHECK: Comparison to NULL could be written "!vhcis" Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index d3933979689f8cd141b3554e902c1e7b9fc6c694..e989be33ada00d5073f5753b72b= b71d349c67b83 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1131,7 +1131,7 @@ static int hcd_name_to_id(const char *name) int ret; =20 c =3D strchr(name, '.'); - if (c =3D=3D NULL) + if (!c) return 0; =20 ret =3D kstrtol(c + 1, 10, &val); @@ -1521,7 +1521,7 @@ static int __init vhci_hcd_init(void) vhci_num_controllers =3D 1; =20 vhcis =3D kcalloc(vhci_num_controllers, sizeof(struct vhci), GFP_KERNEL); - if (vhcis =3D=3D NULL) + if (!vhcis) return -ENOMEM; =20 ret =3D platform_driver_register(&vhci_driver); --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 225B72FFDC0; Tue, 2 Sep 2025 11:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814228; cv=none; b=P58CakZEicAbl81RgwheJjBaSLX4QRC4KpCrkS7tBQNIKVGgc9hrFVuM3HXTJDNM9ttnPhF3GmRtRRLp2ued9SOedmo8mCMFaGsmiKXeCFVP5F7xsSLD75Tzv8OfaPGXWzqThfCrERGMfRR3GE8whUurlAEikllan0HH1YZ0KDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814228; c=relaxed/simple; bh=9uEZ6utveXtfTTMtUje7zgLsdsyYKMyPkIX+8uCOD1w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rGqJD7u0H0CsvQtXrGK1y30z/gxESn+L1dMBhyLFGj/3ecz0fVcunjDvIG2V55bzIUvs/KQvbJppFx4X98djnP0FTvjwAMJrhjSKNLag70wWMrpgXYIR0hFpcHFHqtQ5/yOVNs6X2otNVHr0hcMVlFrf4mMShPQIZJyeU+iXVvs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=nzlbz7w2; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="nzlbz7w2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814224; bh=9uEZ6utveXtfTTMtUje7zgLsdsyYKMyPkIX+8uCOD1w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nzlbz7w2COjp10kn3HfBIfWqCXrKFSRW254ZfL5WFL/uXZGxVx0DmY+hqe9SUZxWu v4ADLH/kSK02+ooAY3OAjdM6Z1IuhtDoe6+XUvfxrdXHPcVz2az962/W9GVMhjE54/ UAdvkyGuSZx13nbb8xci67hSZRnR6rbXVKJAa4bi2RRNuJdMrcx6u7lNkPzZ5tbifZ 2Z74rOuS6+zSS6TNgZvgnoRsrJk96nWZVNzS6FTVEEYU5/FBXdze8fIkd2ik//XHnZ nScZJddoOhA7n4d1Nst5q0wN8naVQx0lsiIghNg8yjxGvMFssZ66/tU8liA3zijUmr /RPifgIstZl3w== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 3017417E0C21; Tue, 2 Sep 2025 13:57:04 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:32 +0300 Subject: [PATCH 10/17] usb: vhci-hcd: Simplify kzalloc usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-10-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Use the shorter variants as suggested by checkpatch.pl: CHECK: Prefer kzalloc(sizeof(*priv)...) over kzalloc(sizeof(struct vhci_p= riv)...) CHECK: Prefer kzalloc(sizeof(*unlink)...) over kzalloc(sizeof(struct vhci= _unlink)...) This also improves further maintainability. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e989be33ada00d5073f5753b72bb71d349c67b83..5b9cc84947781f79d69751ebda9= 50cb293db7cb6 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -670,7 +670,7 @@ static void vhci_tx_urb(struct urb *urb, struct vhci_de= vice *vdev) struct vhci_hcd *vhci_hcd =3D vdev_to_vhci_hcd(vdev); unsigned long flags; =20 - priv =3D kzalloc(sizeof(struct vhci_priv), GFP_ATOMIC); + priv =3D kzalloc(sizeof(*priv), GFP_ATOMIC); if (!priv) { usbip_event_add(&vdev->ud, VDEV_EVENT_ERROR_MALLOC); return; @@ -926,7 +926,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) spin_lock(&vdev->priv_lock); =20 /* setup CMD_UNLINK pdu */ - unlink =3D kzalloc(sizeof(struct vhci_unlink), GFP_ATOMIC); + unlink =3D kzalloc(sizeof(*unlink), GFP_ATOMIC); if (!unlink) { spin_unlock(&vdev->priv_lock); spin_unlock_irqrestore(&vhci->lock, flags); --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D99772FE56B; Tue, 2 Sep 2025 11:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814229; cv=none; b=FogNl8tTl4t1Rs+jY0RGCKHpAtZFurvzS78EVcIQqp9mMLMOD0fV4C0KFf+7KCqZ5Ln7smyWYIJvK1rhBD/ebL+K0eoYqycijrySR1tffaIPM+aP+a9X9ePpwIFpzRVQgSo0zt9cN8ckAekIMJGktXVRht65I4gx9QTHpfTFJa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814229; c=relaxed/simple; bh=frPPyOmJEkW6VaQqxMP9t4HLApPpDWQVGoHyIt7wG1M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=We5s2b8tL/gZwk2HIGkYL0Ts/aMviNn9cJoBltHod97ICGeOEH3V8aZwh/XH3Y4fIj5BmLCTqByOFu5FCndfeat9T5l8uUd7miL8meag3Un5PFcvmZFtdJlXFIEmWxPlbRcPr9sq5Tw7EAF+/jvpGgsAoqIf4v3iphiIo9GCV8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=CNOaDqs2; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="CNOaDqs2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814225; bh=frPPyOmJEkW6VaQqxMP9t4HLApPpDWQVGoHyIt7wG1M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CNOaDqs2TRJZzRYh8c5eioqfIVG73KHK5yDZPLwI04Gb2/zhjHFR71ie4HmElGZj6 Bj7lqJMaEH8Uf8kM0zconWb3QbnbBC5Vk4Z9lN51qjanWTn0wkUJZmLoNVY3nWikSV eiQSCZaHNyYv5UNrcgvXE8Tez1pQXdc1+vZ1DljHIaESbKHSTb+tkljiwh0eWyvJWp /CBu+rbC9qvEKC+tKm+mRPRaf027Ji7b4AKwAsVZBhVUlGnBM7GxC0KARciWtEgKGh smPeHyXq+6/qvwFXZ/byt78G0zljzxgrhdOEcMhpzAyVlgGXvyx4uBNrwt1tCSPfHB cSIvGeFbpUKoQ== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 0C2D417E131D; Tue, 2 Sep 2025 13:57:05 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:33 +0300 Subject: [PATCH 11/17] usb: vhci-hcd: Use the paranthesized form of sizeof Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-11-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Fix the sizeof usage issue reported by checkpatch.pl: WARNING: sizeof *desc should be sizeof(*desc) Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 5b9cc84947781f79d69751ebda950cb293db7cb6..3296914dc89e6e7b7754b92d02b= 44de441c6714e 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -286,7 +286,7 @@ static struct { static inline void ss_hub_descriptor(struct usb_hub_descriptor *desc) { - memset(desc, 0, sizeof *desc); + memset(desc, 0, sizeof(*desc)); desc->bDescriptorType =3D USB_DT_SS_HUB; desc->bDescLength =3D 12; desc->wHubCharacteristics =3D cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8A913054EA; Tue, 2 Sep 2025 11:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814229; cv=none; b=j/iEs0slMPlNhqAnaMNWrIIdv4M2DPhqR9ke6WMtg+K/dfO1FxFQxU1HgDXafWhgmCed5LcMRb61DOlsUN2jdpfDaizjupaxQN3dggGyJmIjx3CG+P6yiS/8X2UnsNrjZ4arAZxxBAIrehQ6l2jYjU0adHrpV3PfwZsrVNf8nVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814229; c=relaxed/simple; bh=83EoQWdVANoSjER/yTx9xViOPEM38EGbN/KEGSrB6nA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IZPOcw1WqhApoo07ZH2loR59jmW2LYy8wff2Cq6CxTzRCz9sEKZ8eoAJHf2s5lPwQyIupic55OdUSLpasRyS17QyL9dVMRkohL1zHh6j+edirIfpbof4ZDihA/qT6DLAsthYRxEAyMWhi6bkWyhMiplrXYnFv6+04bHQh+/VCns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=qaEPkOuC; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="qaEPkOuC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814226; bh=83EoQWdVANoSjER/yTx9xViOPEM38EGbN/KEGSrB6nA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qaEPkOuC7HiuUneXZaVbhL+5hsBaxMth2Y+dKcnt3ztpwSKfVIwasj3gXdNAr6Dng 6LnxpSKnv10jrpaLdR5wPLHY9omXMZP8JQONTN9eufJdQl8CatFKcsqgzs+aNtg3Fb yZjGi+d6BtZS5CMQSY4U770IRROeX/3tzqNgYiOBmFywd8BFJktuxE6OxJ9A7/zB1B j997zFW8dBav6gA8cvUBdIhh42Rs99O96onCdD1sWKYAd2bScCTxq35XteFdMsmAaB LzE2RNY5jKKZSmaV8XYX4TlhXtPd/yJTg047TZPYJT2/eUCCKyQAHy6jSe7S+3vyDN WeosXmO6dJrdw== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id E411217E1356; Tue, 2 Sep 2025 13:57:05 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:34 +0300 Subject: [PATCH 12/17] usb: vhci-hcd: Fix block comments Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-12-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Address a couple of comment formatting issues indicated by checkpatch.pl: WARNING: Block comments use a trailing */ on a separate line Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 3296914dc89e6e7b7754b92d02b44de441c6714e..5b4133f08d370499bdbc50fbea7= ecbbc0fbd4b71 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -883,8 +883,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 priv =3D urb->hcpriv; if (!priv) { - /* URB was never linked! or will be soon given back by - * vhci_rx. */ + /* URB was never linked! or will be soon given back by vhci_rx */ spin_unlock_irqrestore(&vhci->lock, flags); return -EIDRM; } @@ -940,8 +939,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 unlink->unlink_seqnum =3D priv->seqnum; =20 - /* send cmd_unlink and try to cancel the pending URB in the - * peer */ + /* Send cmd_unlink and try to cancel the pending URB in the peer */ list_add_tail(&unlink->list, &vdev->unlink_tx); wake_up(&vdev->waitq_tx); =20 --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D1273002DC; Tue, 2 Sep 2025 11:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814230; cv=none; b=I1R4OZWFPeJytb9iauJTCnz7JpZdYYDBzb0lKp5LG1mnRSmcxlKd7PVRg2zQcxPTY2Fjvd+RfB4RUuHdkgdPQp//SXQaWLF/nhhtQ6puJUfXQTrWJvwxlxjQ9aRU/24GVMllCKwkZk6rl5JKCAAz05M7+QP+iliG+mrxsPB/SVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814230; c=relaxed/simple; bh=X3G+4Hfvkhb+UQsB/BD9eP8MNRGk6kjxDpXAACkKBqg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G0sxQ+2zQNGdbRdkogeTBosu3G06axwtuWTFYGPlGDqG5qMU5/hgufo/baPHHH/6qJZmhrNz6bnhGiTzuA9woGL0kBUfV5/YIWUAnLNi9kgINGFwXsP8HVtoGlfZBpw9Mh/RCOpBc3+3EnP29XcN/yXCm/2LJ/AFbcQhPnZtt/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=PMv12iC+; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="PMv12iC+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814226; bh=X3G+4Hfvkhb+UQsB/BD9eP8MNRGk6kjxDpXAACkKBqg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PMv12iC+cAbKQPHejVIs5nPM/vp6S5dUlPuh1DjM/UIcDWA6t8b9uFfNEUkovpen8 Vpk3tqaxzuvAlybZhEFOQ33/HqWZn8S3afsmdANFH5y5su4DJASVmDTRVewNp4Wq6P K4orbbWnqt30nRbNFknJ7iqJiR6OwCeTovFOkJT8kZNKhKYTc2H93bhTCaG1SR+2aH F4felpCo/93n1my8D1EiHLcpcNcPUHZsYSB+tcisVkrUzqmXt1e5r6M47caei5eyeY mbl5YH7WXh+hP60jaBalVUHq1O6yMIfkDufSaO1+48QfRk2+pj2Yt3G0RXRweUONrX JOmTc5n2PC1Mw== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id B65A117E1333; Tue, 2 Sep 2025 13:57:06 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:35 +0300 Subject: [PATCH 13/17] usb: vhci-hcd: Remove ftrace-like logging Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-13-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Drop all superfluous log entries as reported by checkpatch: WARNING: Unnecessary ftrace-like logging - prefer using ftrace Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 5b4133f08d370499bdbc50fbea7ecbbc0fbd4b71..a71a542e6eec42c79cff091fe01= 68f44c8c9b4b2 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1260,8 +1260,6 @@ static int vhci_bus_suspend(struct usb_hcd *hcd) struct vhci *vhci =3D *((void **)dev_get_platdata(hcd->self.controller)); unsigned long flags; =20 - dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); - spin_lock_irqsave(&vhci->lock, flags); hcd->state =3D HC_STATE_SUSPENDED; spin_unlock_irqrestore(&vhci->lock, flags); @@ -1275,8 +1273,6 @@ static int vhci_bus_resume(struct usb_hcd *hcd) int rc =3D 0; unsigned long flags; =20 - dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); - spin_lock_irqsave(&vhci->lock, flags); =20 if (!HCD_HW_ACCESSIBLE(hcd)) @@ -1428,8 +1424,6 @@ static int vhci_hcd_suspend(struct platform_device *p= dev, pm_message_t state) int ret =3D 0; unsigned long flags; =20 - dev_dbg(&pdev->dev, "%s\n", __func__); - hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; @@ -1467,8 +1461,6 @@ static int vhci_hcd_resume(struct platform_device *pd= ev) { struct usb_hcd *hcd; =20 - dev_dbg(&pdev->dev, "%s\n", __func__); - hcd =3D platform_get_drvdata(pdev); if (!hcd) return 0; --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB19306D3F; Tue, 2 Sep 2025 11:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814231; cv=none; b=dZawysY+OBpUu1y2vy8YqkY1BIQZn92KKss1h7NaIKxi62Xc3pHVGucKeT+nEXmAcOZEavBqg/1y+44guBS426pT6Bs16wbp5Ur7IPRBbG5+hSuIWDz/2iL2AJp2ASTlznnS4dqgGUwgHhVv/hlqEbxi8erl2j/WtBxOxd8o3f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814231; c=relaxed/simple; bh=yE4k/N92zxT8/ez56q76hETeCl2+RzWZurf0SczBZ1s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aSRyKEkUFDh992Lp7mz3hrneyZzjm1ZNw3AglknCLYsn3Jc7QTmY8McJf0+FwqYEHLn7XfKotY4JrdIczvdHPY/YplqcvmSnZMs2SefsdbkWn3PaFl92mheAqbujqm0LBdAPJq59z+bo1NA8DA1Ecu1njH24caW43ToX7zFVCks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ZyluWRcc; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZyluWRcc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814227; bh=yE4k/N92zxT8/ez56q76hETeCl2+RzWZurf0SczBZ1s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZyluWRccMxk7iA3YNY/oikM/fS8xnj9abGZpRiAwVUeXK2ISLokIJNa3XY98JJVat E7j9i+mULdp74VwdtBXo59UaCJR2/JMOOd+UKLOvjma6G5u/ZtYfP/c/JT4Vq4qQHk EybmQJDYcF4gXXDEey2eSArbS5GH7AbmH+xOL7gHWPzAoELprCjYBZ2Tiqte0gKj1x 2/c6uwZCoq+zlcBbL73t4tdZUJujnOxGaVIXQVTZf3+MJR7+uf2O5dN9wtKLbBSrxZ aeR6vU2HLESiARf5X4LqAmVr/sG2mwHZ3KVHWg5HjUh40t0skBYEpdFCP8nftD/68P MsJnrC6MnLB8A== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 7E6C917E1355; Tue, 2 Sep 2025 13:57:07 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:36 +0300 Subject: [PATCH 14/17] usb: vhci-hcd: Consistently use __func__ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-14-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Replace all explicit function names in string literals with __func__ and silent several checkpatch complaints similar to the following one: WARNING: Prefer using '"%s...", __func__' to using 'vhci_start', this fun= ction's name, in a string In case of the usbip_dbg_*() helpers, which are wrappers over pr_debug(), the function names end up duplicated, hence replace the superfluous strings with some useful info or simply drop the log entries altogether if they become ftrace-like. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index a71a542e6eec42c79cff091fe0168f44c8c9b4b2..c790e3a435e2b1493c1ed88d3a9= 8edb7c2e35912 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -160,8 +160,6 @@ void rh_port_connect(struct vhci_device *vdev, enum usb= _device_speed speed) u32 status; unsigned long flags; =20 - usbip_dbg_vhci_rh("rh_port_connect %d\n", rhport); - spin_lock_irqsave(&vhci->lock, flags); =20 status =3D vhci_hcd->port_status[rhport]; @@ -183,6 +181,8 @@ void rh_port_connect(struct vhci_device *vdev, enum usb= _device_speed speed) =20 spin_unlock_irqrestore(&vhci->lock, flags); =20 + usbip_dbg_vhci_rh("rhport: %d status: %u\n", rhport, status); + usb_hcd_poll_rh_status(vhci_hcd_to_hcd(vhci_hcd)); } =20 @@ -194,8 +194,6 @@ static void rh_port_disconnect(struct vhci_device *vdev) u32 status; unsigned long flags; =20 - usbip_dbg_vhci_rh("rh_port_disconnect %d\n", rhport); - spin_lock_irqsave(&vhci->lock, flags); =20 status =3D vhci_hcd->port_status[rhport]; @@ -206,6 +204,9 @@ static void rh_port_disconnect(struct vhci_device *vdev) vhci_hcd->port_status[rhport] =3D status; =20 spin_unlock_irqrestore(&vhci->lock, flags); + + usbip_dbg_vhci_rh("rhport: %d status: %u\n", rhport, status); + usb_hcd_poll_rh_status(vhci_hcd_to_hcd(vhci_hcd)); } =20 @@ -1173,8 +1174,6 @@ static int vhci_start(struct usb_hcd *hcd) int id, rhport; int err; =20 - usbip_dbg_vhci_hc("enter vhci_start\n"); - if (usb_hcd_is_primary_hcd(hcd)) spin_lock_init(&vhci_hcd->vhci->lock); =20 @@ -1296,7 +1295,7 @@ static int vhci_alloc_streams(struct usb_hcd *hcd, st= ruct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, unsigned int num_streams, gfp_t mem_flags) { - dev_dbg(&hcd->self.root_hub->dev, "vhci_alloc_streams not implemented\n"); + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__); return 0; } =20 @@ -1305,7 +1304,7 @@ static int vhci_free_streams(struct usb_hcd *hcd, str= uct usb_device *udev, struct usb_host_endpoint **eps, unsigned int num_eps, gfp_t mem_flags) { - dev_dbg(&hcd->self.root_hub->dev, "vhci_free_streams not implemented\n"); + dev_dbg(&hcd->self.root_hub->dev, "%s not implemented\n", __func__); return 0; } =20 --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB7DA255F5C; Tue, 2 Sep 2025 11:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814231; cv=none; b=Z2mC8JZvVAPWPAqwkd+zdaOlLDV9WYrlHWbiLRrgQ5MzZ36M090XfHH1Bd5uSAEM13MffGZQnGGMJYaU5zKA8AEriVo1tB2UOw0jN9QRxa8zX794Y+CNawU9O2KvXF/10H6M49K/miodFFK4tww/qswAF7WBSPLk+sVQAazSuxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814231; c=relaxed/simple; bh=KGlUlP+wqP8TkULvUNOhgzB0XAxuC0vVIsj3uFCmKRE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FL++IF8kEeAbziVVD7q6kfHCKXOkDqqwM4MJtu8+mrdf96lrDOjsEuWjoZJF39sRqQIcppe5CfH0bQmsEnxUq1NXqdkOJkEzBwW8VvKWIjQZLlTt5vffAYtyrbhsMCYfKqzFrjgg8JlAHAr8nj8OK2FK3sPZs3DZs5tGCZJDYME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=BP1MMOSS; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="BP1MMOSS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814228; bh=KGlUlP+wqP8TkULvUNOhgzB0XAxuC0vVIsj3uFCmKRE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BP1MMOSSTBo7VEaXomhy/iR+6nI5qUMk4Ph9SeYS7NnudVVB56ryt0/X7tVdtKp+V 6kDxx8jpSnA3/2hBJ7475aFOIt8ueHMpPAkVSaFkZsvI/RqlHTr63FBZCueQ4OsE5Y NhLZOImCADkWXmPSggonbJuVYVXeYn77+vHW1+4PMTkJcXYKWpT+WdWG/38RKIazbP bRitUhOf5DNPds6zc4xw7rHXvObZiI4vxGG7TYyjk6Z16/99kBQDcq0Zrm6Kij07Ho lJdfgp+AF/zVwJOk/8AuePTya3VxHVPH2QetACzSRUrj1N4qVmQw5Igun8ohfTsAMh HLCTvx3bjMfHg== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 46C4117E135D; Tue, 2 Sep 2025 13:57:08 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:37 +0300 Subject: [PATCH 15/17] usb: vhci-hcd: Do not split quoted strings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-15-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Join the split strings to make checkpatch happy and regain ability to grep for those log messages in the source code: WARNING: quoted string split across lines While at it, replace the affected pr_err() calls with dev_err(). Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index c790e3a435e2b1493c1ed88d3a98edb7c2e35912..9e88fe6424f723709c07e91df21= 481ae91c1f1b5 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -377,8 +377,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, switch (wValue) { case USB_PORT_FEAT_SUSPEND: if (hcd->speed >=3D HCD_USB3) { - pr_err(" ClearPortFeature: USB_PORT_FEAT_SUSPEND req not " - "supported for USB 3.0 roothub\n"); + dev_err(hcd_dev(hcd), + "ClearPortFeature: USB_PORT_FEAT_SUSPEND req not supported for USB 3.= 0 roothub\n"); goto error; } =20 @@ -507,8 +507,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_LINK_STATE: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_LINK_STATE\n"); if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_LINK_STATE req not " - "supported for USB 2.0 roothub\n"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_LINK_STATE req not supported for USB 2.0 roothub\n"); goto error; } =20 @@ -524,8 +524,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_U2_TIMEOUT\n"); /* TODO: add suspend/resume support! */ if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_U1/2_TIMEOUT req not " - "supported for USB 2.0 roothub\n"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_U1/2_TIMEOUT req not supported for USB 2.0 roothub\n"); goto error; } break; @@ -533,8 +533,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_SUSPEND\n"); /* Applicable only for USB2.0 hub */ if (hcd->speed >=3D HCD_USB3) { - pr_err("USB_PORT_FEAT_SUSPEND req not " - "supported for USB 3.0 roothub\n"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_SUSPEND req not supported for USB 3.0 roothub\n"); goto error; } =20 @@ -566,8 +566,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, =20 /* Applicable only for USB3.0 hub */ if (hcd->speed < HCD_USB3) { - pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " - "supported for USB 2.0 roothub\n"); + dev_err(hcd_dev(hcd), + "USB_PORT_FEAT_BH_PORT_RESET req not supported for USB 2.0 roothub\n"= ); goto error; } fallthrough; @@ -621,8 +621,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case GetPortErrorCount: usbip_dbg_vhci_rh(" GetPortErrorCount\n"); if (hcd->speed < HCD_USB3) { - pr_err("GetPortErrorCount req not " - "supported for USB 2.0 roothub\n"); + dev_err(hcd_dev(hcd), + "GetPortErrorCount req not supported for USB 2.0 roothub\n"); goto error; } /* We'll always return 0 since this is a dummy hub */ @@ -631,8 +631,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case SetHubDepth: usbip_dbg_vhci_rh(" SetHubDepth\n"); if (hcd->speed < HCD_USB3) { - pr_err("SetHubDepth req not supported for " - "USB 2.0 roothub\n"); + dev_err(hcd_dev(hcd), + "SetHubDepth req not supported for USB 2.0 roothub\n"); goto error; } break; --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 960E93081B8; Tue, 2 Sep 2025 11:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814232; cv=none; b=G/rEkFN/LS62rLEEA4Dz+tSVo93vn3Sue/XYN1K3/nGDqbNJzGfo+TiKlQg9BvpICYlds7XdqBSOLS55JIe1lO707w1vrOdqojSED3hjwWKqHLkDWk5z7qRjEYPsh5TCIszVH+3TFuUK8rR50i9zOJXc214yga4dayruBEGbhiw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814232; c=relaxed/simple; bh=pxp/AjuqCxmQtXbkgQBKdOvYIqT/+fTupjCzJc3e4MQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B0fMY8etzQTX/pLp0FGTitt4u6dhDBwZ1j4d0GYzSif+3Asf95Pmzca4WpoKB6wVOoUhYHrqYRy1rO2hahTSDqEYXk13aZyn9TVskcAT0S4Zmkl8YNPm8Bo6HNhzcVmYROIc7FSAXaAELtFFFJ2vHj8Zk8bZin/70RFndg/68iA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hPftfvSo; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hPftfvSo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814229; bh=pxp/AjuqCxmQtXbkgQBKdOvYIqT/+fTupjCzJc3e4MQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hPftfvSocgMhQ4oJxnOX1b9IrnvUq+JYLX/DhIZsJ4POlkM6UzWVOxNlfafr6sMPk AJfcJNFARMEvt61Pu+hqYmF2CrgX8zSazpAoiN4COfUi4/fsnOPeukq9hZX97p83DR EstqtI99LsQnZXGBrSzf8H4JlcoCkyuDBvTZ/1kduv1o4rwa1tI0neDw5yo9Ql1y5h WrZftV8Ci56LUEXTiTzHvrVlBGDkioYmJFlxjPvqlgAKLsDq5eBxP9kxg655MgtiIK rMX6tmVhlOtnPikS6wuwNHvbZ3HmQLOyb82IU8e8pEcHJUUQQ7DqxOOIPv4gIjKP0q uHe5bALY4IAKA== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id 0FD6717E1353; Tue, 2 Sep 2025 13:57:09 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:38 +0300 Subject: [PATCH 16/17] usb: vhci-hcd: Switch to dev_err_probe() in probe path Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-16-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Replace pr_err() calls in vhci_hcd_probe() with dev_err_probe(), to simplify error handling a bit and improve consistency. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 9e88fe6424f723709c07e91df21481ae91c1f1b5..8304df3dc94c415bea5252dc004= 4611f4c862ba5 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1347,10 +1347,8 @@ static int vhci_hcd_probe(struct platform_device *pd= ev) * Our private data is also allocated automatically. */ hcd_hs =3D usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->de= v)); - if (!hcd_hs) { - pr_err("create primary hcd failed\n"); - return -ENOMEM; - } + if (!hcd_hs) + return dev_err_probe(&pdev->dev, -ENOMEM, "create primary hcd failed\n"); =20 hcd_hs->has_tt =3D 1; =20 @@ -1359,22 +1357,21 @@ static int vhci_hcd_probe(struct platform_device *p= dev) * Call the driver's reset() and start() routines. */ ret =3D usb_add_hcd(hcd_hs, 0, 0); - if (ret !=3D 0) { - pr_err("usb_add_hcd hs failed %d\n", ret); + if (ret) { + dev_err_probe(&pdev->dev, ret, "usb_add_hcd hs failed\n"); goto put_usb2_hcd; } =20 hcd_ss =3D usb_create_shared_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev), hcd_hs); if (!hcd_ss) { - ret =3D -ENOMEM; - pr_err("create shared hcd failed\n"); + ret =3D dev_err_probe(&pdev->dev, -ENOMEM, "create shared hcd failed\n"); goto remove_usb2_hcd; } =20 ret =3D usb_add_hcd(hcd_ss, 0, 0); if (ret) { - pr_err("usb_add_hcd ss failed %d\n", ret); + dev_err_probe(&pdev->dev, ret, "usb_add_hcd ss failed\n"); goto put_usb3_hcd; } =20 --=20 2.51.0 From nobody Fri Oct 3 10:15:33 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B322830ACF9; Tue, 2 Sep 2025 11:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814234; cv=none; b=SoUqusNeKrb5vhIfgOcSZA9r/j/7enW02OzDV1gnHk2fuWQ8EN4Ig5UcZZPr2Csaefhv/gD6Sleav5tFAeaWxa1VsUBNLf+I92KyRgMsowBObROzV1LM8ZPEEMW+jIuUNBOi+rcoXFDJ0p25Q+USP8Shpx7FUuWDNCY3KYe5/Yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756814234; c=relaxed/simple; bh=X2wWmrA7oxTuQEVLARGVrxI0qGFtwivbsfhTFPTU2wc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qqjPKwcyp65UG8oZWT6crKyCQMtvAFN4DGR0/+ZXrPEO07XprzUTl+BBXfwlnrVFU+XiO+HyiHiFquWLvvgkrZVE7QYe4Qrp9nMktH/LcxeRU4wA8Io+ozjf3PuEG7a8SzLWwHd4KiT2RKKHyD4PEtqcRJiYxl4FvO56p8h6w5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hIwOtF85; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hIwOtF85" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1756814230; bh=X2wWmrA7oxTuQEVLARGVrxI0qGFtwivbsfhTFPTU2wc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hIwOtF85SbWrwXLcYnYeRvsNTlEAgL8YD8p8b6eB8ABB9l6TYtRVBGJakLlHeWWGh mK7Ke6zgEUjBnJG9yWOrjO7eAg4FqdkwwtPnze2gBVv88LqJWC2dtxW80Abb+dScAy aWf6u8p6JBuZgKMsF3xwvgdlU8q1YbtTlNzUgAVjAkT89YS4XJnPUgWoX3LYeKaROM Aw63UNt9yMbaobdytQ4s8m4KOJPIClR8vxotAXLHQdAXfZG5Zff7BbfXlksan7NShL KMBZhrxsGdwIwxAWXisGxc3GyPgPPnKPH6ODlmt3nEdSv9/q+1vfa0cIyhz+91JlAJ 1nrjzGFfKwJ0Q== Received: from localhost (unknown [82.79.138.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with UTF8SMTPSA id CB50617E10B7; Tue, 2 Sep 2025 13:57:09 +0200 (CEST) From: Cristian Ciocaltea Date: Tue, 02 Sep 2025 14:56:39 +0300 Subject: [PATCH 17/17] usb: vhci-hcd: Replace pr_*() with dev_*() logging Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250902-vhci-hcd-cleanup-v1-17-1d46247cb234@collabora.com> References: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> In-Reply-To: <20250902-vhci-hcd-cleanup-v1-0-1d46247cb234@collabora.com> To: Valentina Manea , Shuah Khan , Hongren Zheng , Greg Kroah-Hartman Cc: kernel@collabora.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 Where possible, use driver model logging helpers dev_*() instead of pr_*() to ensure the messages are always associated with the corresponding device/driver. Signed-off-by: Cristian Ciocaltea --- drivers/usb/usbip/vhci_hcd.c | 43 +++++++++++++++++++++++-----------------= --- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 8304df3dc94c415bea5252dc0044611f4c862ba5..64fe2f9e22f13b7d0234319521e= 0a7282c65411a 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -347,7 +347,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, if (wIndex < 1 || wIndex > VHCI_HC_PORTS) { invalid_rhport =3D true; if (wIndex > VHCI_HC_PORTS) - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); } else { rhport =3D wIndex - 1; } @@ -370,7 +370,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, break; case ClearPortFeature: if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -410,7 +410,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh(" GetHubDescriptor\n"); if (hcd->speed >=3D HCD_USB3 && (wLength < USB_DT_SS_HUB_SIZE || wValue !=3D (USB_DT_SS_HUB << 8))) { - pr_err("Wrong hub descriptor type for USB 3.0 roothub.\n"); + dev_err(hcd_dev(hcd), + "Wrong hub descriptor type for USB 3.0 roothub.\n"); goto error; } =20 @@ -436,7 +437,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case GetPortStatus: usbip_dbg_vhci_rh(" GetPortStatus port %x\n", wIndex); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); retval =3D -EPIPE; goto error; } @@ -485,7 +486,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, USB_PORT_STAT_LOW_SPEED; break; default: - pr_err("vhci_device speed not set\n"); + dev_err(hcd_dev(hcd), "vhci_device speed not set\n"); break; } } @@ -539,7 +540,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -548,7 +549,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_POWER: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_POWER\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -560,7 +561,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_BH_PORT_RESET: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -574,7 +575,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, case USB_PORT_FEAT_RESET: usbip_dbg_vhci_rh("SetPortFeature: USB_PORT_FEAT_RESET\n"); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -598,7 +599,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, usbip_dbg_vhci_rh(" SetPortFeature: default %d\n", wValue); if (invalid_rhport) { - pr_err("invalid port number %d\n", wIndex); + dev_err(hcd_dev(hcd), "invalid port number %d\n", wIndex); goto error; } =20 @@ -637,7 +638,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } break; default: - pr_err("default hub control req: %04x v%04x i%04x l%d\n", + dev_err(hcd_dev(hcd), + "default hub control req: %04x v%04x i%04x l%d\n", typeReq, wValue, wIndex, wLength); error: /* "protocol stall" on error */ @@ -645,7 +647,7 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 ty= peReq, u16 wValue, } =20 if (usbip_dbg_flag_vhci_rh) { - pr_debug("port %d\n", rhport); + dev_dbg(hcd_dev(hcd), "%s port %d\n", __func__, rhport); /* Only dump valid port status */ if (!invalid_rhport) { dump_port_status_diff(prev_port_status[rhport], @@ -705,7 +707,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct= urb *urb, gfp_t mem_flag unsigned long flags; =20 if (portnum > VHCI_HC_PORTS) { - pr_err("invalid port number %d\n", portnum); + dev_err(hcd_dev(hcd), "invalid port number %d\n", portnum); return -ENODEV; } vdev =3D &vhci_hcd->vdev[portnum - 1]; @@ -936,7 +938,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct= urb *urb, int status) =20 unlink->seqnum =3D atomic_inc_return(&vhci_hcd->seqnum); if (unlink->seqnum =3D=3D 0xffff) - pr_info("seqnum max\n"); + dev_info(hcd_dev(hcd), "seqnum max\n"); =20 unlink->unlink_seqnum =3D priv->seqnum; =20 @@ -1013,10 +1015,11 @@ static void vhci_device_unlink_cleanup(struct vhci_= device *vdev) static void vhci_shutdown_connection(struct usbip_device *ud) { struct vhci_device *vdev =3D container_of(ud, struct vhci_device, ud); + struct usb_hcd *hcd =3D vhci_hcd_to_hcd(vdev_to_vhci_hcd(vdev)); =20 /* need this? see stub_dev.c */ if (ud->tcp_socket) { - pr_debug("shutdown tcp_socket %d\n", ud->sockfd); + dev_dbg(hcd_dev(hcd), "shutdown tcp_socket %d\n", ud->sockfd); kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); } =20 @@ -1029,7 +1032,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) kthread_stop_put(vdev->ud.tcp_tx); vdev->ud.tcp_tx =3D NULL; } - pr_info("stop threads\n"); + dev_info(hcd_dev(hcd), "stop threads\n"); =20 /* active connection is closed */ if (vdev->ud.tcp_socket) { @@ -1037,7 +1040,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) vdev->ud.tcp_socket =3D NULL; vdev->ud.sockfd =3D -1; } - pr_info("release socket\n"); + dev_info(hcd_dev(hcd), "release socket\n"); =20 vhci_device_unlink_cleanup(vdev); =20 @@ -1063,7 +1066,7 @@ static void vhci_shutdown_connection(struct usbip_dev= ice *ud) */ rh_port_disconnect(vdev); =20 - pr_info("disconnect device\n"); + dev_info(hcd_dev(hcd), "disconnect device\n"); } =20 static void vhci_device_reset(struct usbip_device *ud) @@ -1197,7 +1200,7 @@ static int vhci_start(struct usb_hcd *hcd) =20 id =3D hcd_name_to_id(hcd_name(hcd)); if (id < 0) { - pr_err("invalid vhci name %s\n", hcd_name(hcd)); + dev_err(hcd_dev(hcd), "invalid vhci name %s\n", hcd_name(hcd)); return -EINVAL; } =20 @@ -1216,7 +1219,7 @@ static int vhci_start(struct usb_hcd *hcd) return err; } =20 - pr_info("created sysfs %s\n", hcd_name(hcd)); + dev_info(hcd_dev(hcd), "created sysfs %s\n", hcd_name(hcd)); } =20 return 0; --=20 2.51.0