From nobody Mon Sep 15 21:42:18 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B86D0C46467 for ; Tue, 10 Jan 2023 20:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233958AbjAJU47 (ORCPT ); Tue, 10 Jan 2023 15:56:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbjAJU4r (ORCPT ); Tue, 10 Jan 2023 15:56:47 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD8B5950E for ; Tue, 10 Jan 2023 12:56:47 -0800 (PST) Received: from dslb-178-004-206-224.178.004.pools.vodafone-ip.de ([178.4.206.224] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pFLfl-0001pw-3j; Tue, 10 Jan 2023 21:56:41 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 4/4] staging: r8188eu: always process urb status Date: Tue, 10 Jan 2023 21:56:26 +0100 Message-Id: <20230110205626.183516-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230110205626.183516-1-martin@kaiser.cx> References: <20230110205626.183516-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove the if clause in usb_write_port_complete and process the urb status regardless of bSurpriseRemoved, bDriverStopped and bWritePortCancel. The only possible results of urb status processing are updates to bSurpriseRemoved and bDriverStopped. All of the three status variable are set to true only if the whole USB processing has to be stopped (when the driver is unloaded or when the system goes to sleep). It's no problem if one of the "stop everything" variables is already set and the urb status processing sets another one. This patch removes the last goto in usb_write_port_complete. It's also part of the ongoing effort to limit the use of the "stop everything" variables. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/stagi= ng/r8188eu/os_dep/usb_ops_linux.c index 3fd080091340..62106d2f82ad 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -44,9 +44,6 @@ static void usb_write_port_complete(struct urb *purb) if (pxmitbuf->flags =3D=3D HIGH_QUEUE_INX) rtw_chk_hi_queue_cmd(padapter); =20 - if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->b= WritePortCancel) - goto check_completion; - switch (purb->status) { case 0: case -EINPROGRESS: @@ -63,7 +60,6 @@ static void usb_write_port_complete(struct urb *purb) break; } =20 -check_completion: rtw_sctx_done_err(&pxmitbuf->sctx, purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS); rtw_free_xmitbuf(pxmitpriv, pxmitbuf); --=20 2.30.2