From patchwork Tue Jan 10 20:56:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 41652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2968907wrt; Tue, 10 Jan 2023 13:06:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXv78RBw8+mUyBxmxzwzk7j8ltrL/tTxXYJ2G5fSktXPIZX4XepUj0rrrYw+JjuaUX5erc8B X-Received: by 2002:a17:906:5202:b0:7c1:4a3:10b6 with SMTP id g2-20020a170906520200b007c104a310b6mr58478239ejm.53.1673384767773; Tue, 10 Jan 2023 13:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384767; cv=none; d=google.com; s=arc-20160816; b=mNwvzX0BnPTjQNel0V5hfBD9tLCPJ6sS6ylOm03cPc2Nfy7/g2Ix3vI/u3HU6I9uAi QwuvlL6T9FZi9WMOALOD0gLZmvL/r7PkABYynaRnzbXxZ6liXjlKT9XRK/xUsWylTdAh 0/by5Nqh0ogQGrrLEAgcDLLFVOpnPuzSFat+dDRKAtfG2PgJL1J2whTXCE2HqcL4i1y8 HVk+NY06/TN5XhxtWIrnRuJ5ktKYY03iu1/k+L1BJPrc43and8P0h2mZkXreCC6N5IsR dRBScc5z0PiYkXox7nhaNZCXmIzelcklULRvlVIbezva/zrcy8gHN8WoQqFFTCN855er Qr7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zE4J3o2888grPFMwQk4eYi07KXQPp7BePJrAnoS6UV8=; b=u8ZZjKIwdbqbaPHKFqjvQL9Wp1JTHPOMekQ/NZNh85cFoCuGep3L0w9jVXkHQd7L74 v+jvcmTYnyqnUxlAyWJ9f5gw1xoueD7vQlohEvXRkbc9t6oUfIJsjQf3o9VbAJvSmfER 5RgfF5Bq5+FN41G8wsaa0O0yz61zcaLcHvG5YKwAFOnOADvjXS/L4wn/PBMPC19WXYmT 0fJoJudLBNKsWyz7EZYyaOlOhWiGTkarB1zFyHcV//YKfP86Uyz9fdVzpTuEL480SdXs eKvrlHCL0eCeZWVf0kcI8Ieh7XPlqrweXxH+h1CAmKkeIGrf4Haa3rinMiD5fXdkxQ4J A3jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a170906975200b0084514612c25si13399391ejy.604.2023.01.10.13.05.44; Tue, 10 Jan 2023 13:06:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233501AbjAJU5A (ORCPT + 99 others); Tue, 10 Jan 2023 15:57:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233891AbjAJU4r (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 A51CB12A94 for ; Tue, 10 Jan 2023 12:56:44 -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 1pFLfi-0001pw-NV; Tue, 10 Jan 2023 21:56:38 +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 1/4] staging: r8188eu: refactor status handling in usb_write_port_complete Date: Tue, 10 Jan 2023 21:56:23 +0100 Message-Id: <20230110205626.183516-2-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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754671105955186700?= X-GMAIL-MSGID: =?utf-8?q?1754671105955186700?= Refactor the satus handling in usb_write_port_complete. Make it clearer what happens for each status and avoid all the goto statements. Signed-off-by: Martin Kaiser --- .../staging/r8188eu/os_dep/usb_ops_linux.c | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index 257bcf496012..8494b80a08e5 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -48,21 +48,20 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) padapter->bWritePortCancel) goto check_completion; - if (purb->status) { - if (purb->status == -EINPROGRESS) { - goto check_completion; - } else if (purb->status == -ENOENT) { - goto check_completion; - } else if (purb->status == -ECONNRESET) { - goto check_completion; - } else if (purb->status == -ESHUTDOWN) { - padapter->bDriverStopped = true; - goto check_completion; - } else if ((purb->status != -EPIPE) && (purb->status != -EPROTO)) { - padapter->bSurpriseRemoved = true; - - goto check_completion; - } + switch (purb->status) { + case 0: + case -EINPROGRESS: + case -ENOENT: + case -ECONNRESET: + case -EPIPE: + case -EPROTO: + break; + case -ESHUTDOWN: + padapter->bDriverStopped = true; + break; + default: + padapter->bSurpriseRemoved = true; + break; } check_completion: From patchwork Tue Jan 10 20:56:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 41653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2969359wrt; Tue, 10 Jan 2023 13:07:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXvfKcOi3L/C+ObrzRm0E/z80GIAX3B4U2AJ2L5nnE1m8hIdW7rGY6iUamj4rFeNnr0W3ZBS X-Received: by 2002:a05:6402:3786:b0:496:873:bb43 with SMTP id et6-20020a056402378600b004960873bb43mr15971408edb.16.1673384831140; Tue, 10 Jan 2023 13:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384831; cv=none; d=google.com; s=arc-20160816; b=uU3Ukv5ifJIp6JBkVuEsHJrDSeIEBCfYX4kK0tHKWoEJG5bjhbfmDiuLNfOpapEhsa dlTPSUv0/rH7DEB9ZqzUZrJjcPsTQyQt6Cu6eLjmrFOHsJu8awvywicTKvTObo1rWFvv he8SoEQy0VUmje6mY1gSsYOUvAWL2cPYczWvnsi+wVALe92U2JSqV8EgpzSpvko5YUnr d3Dny9/yRWDO0fdJ7LHu7cddgRQ7KNljFvObQiIqjk4C1gibe0FMn58udIQ0jvI90wIW 0e1x8GTYkps0BOG0c2WG0ugynJ2RRPvwd8JaCfls7bIE/9cj988zNWoUyd0kFHqporL0 mHLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TjI0iW8DzHA9UMgnVzNVDWf38gxcsx5rroch6axpQNI=; b=gSm5t1nyaUxZJRoYrF5at2vPvunFSLc87i5Z40L0geKOmjMdrcET6jfs9iWymhammK oy0SSfW9zmQ17HVc+0Qcr5amWwcfS6ojNY73MjKtEdedy/IaVonjg/ezP92DzpWZyWo2 pe0pJFd3QO8cIIWF9Xrnnx3JtWjC29t/YfDdJc0XuSpWjubNnWVRcXZGc8v15Gse+JoT VVPFQK0wu2fE8uXqX9VQoUjjt+3t6ztkz2SRJheqtfBlD4rJyRUcVbwXLSjCq9dVtyNR oodaGdpsf5i1gFTPQQv/OC1s2jFlfqDOwaa/BGcL60JNTI0cCZLoF/Ow3HGAQmqUteEn sUVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a056402280a00b00443088b40b7si16773858ede.123.2023.01.10.13.06.47; Tue, 10 Jan 2023 13:07:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234267AbjAJU5E (ORCPT + 99 others); Tue, 10 Jan 2023 15:57:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233426AbjAJU4r (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 B8B275950D for ; Tue, 10 Jan 2023 12:56:46 -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 1pFLfj-0001pw-H5; Tue, 10 Jan 2023 21:56:39 +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 2/4] staging: r8188eu: reformat usb_write_port_complete Date: Tue, 10 Jan 2023 21:56:24 +0100 Message-Id: <20230110205626.183516-3-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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754671172607436736?= X-GMAIL-MSGID: =?utf-8?q?1754671172607436736?= This trivial patch reformats the usb_write_port_complete function. Hopefully, this makes the code a bit easier to read. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index 8494b80a08e5..7da13b87d726 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -38,14 +38,13 @@ void rtw_read_port_cancel(struct adapter *padapter) static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) { struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context; - struct adapter *padapter = pxmitbuf->padapter; - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; + struct adapter *padapter = pxmitbuf->padapter; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; if (pxmitbuf->flags == HIGH_QUEUE_INX) rtw_chk_hi_queue_cmd(padapter); - if (padapter->bSurpriseRemoved || padapter->bDriverStopped || - padapter->bWritePortCancel) + if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->bWritePortCancel) goto check_completion; switch (purb->status) { @@ -66,13 +65,9 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) check_completion: rtw_sctx_done_err(&pxmitbuf->sctx, - purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : - RTW_SCTX_DONE_SUCCESS); - + purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS); rtw_free_xmitbuf(pxmitpriv, pxmitbuf); - tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); - } u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem) From patchwork Tue Jan 10 20:56:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 41651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2968847wrt; Tue, 10 Jan 2023 13:05:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAcNzj4bGulIR3YjUGfADdiKdaM+omCch0rH1FzdrC0YcCSwpDrdBrKuwGwMfB3mDHtMtc X-Received: by 2002:a17:906:edd6:b0:84d:138a:316 with SMTP id sb22-20020a170906edd600b0084d138a0316mr16860241ejb.36.1673384759040; Tue, 10 Jan 2023 13:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384759; cv=none; d=google.com; s=arc-20160816; b=o7MIPWivA0lAqdwU6k7W9RgD4BI1nxnPEECp6liHZ88s+Wi3mcvpcc7oeFuLNhDxzV /ze9x/kNFdrxtkkt8iXuV7OiWVxb8nn/4ZyYEQ1oRlYao/8XL+gc12iGiPxgzL6Rpe+x PoxIkLb5besRAiZ1jwEOBQk/GovUzl/brR5iqxf11ldC3tD5hZ5A4lP2ww3knfWF1/8u f5UMZt0L8DK040mtqpfbgjSeou4H7c0MyA19vRX6WQaRogXfMLjpBiOPnrFpW5VazEdy LNQOY9eTz5Olcofmv0/XTQO9Si7+x/eJ7SsUoAsaXTk3E6QsxutiNGV49S3gGgHCq3y/ nlLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=duaSGrKtE66rXiV+ofxr8Kmbaffk2hy1kZcv3tEb+G8=; b=mrj2FCy8QOK836SgpxP7Tq/uhPX+48TC9Vm519FyLlAWqmvd7aDgY14/JMKkk9FEsB t8GDSuf8krRt1tvy8VzvKpsOb4DakjeeZS1qYlM6viqkQMC4gHVS6Hkao6U4OWqe+L6T GPTm190HZ2OvyC3ubckem3oaFS8+pT1BcK3tooTbBYhnCB9UGR1ovS0XrJov6LaHx+Na wdXIw1G0ukxjbWBk2urhlD6SV/fuwiP1noa9A/mN4iPt5F5t6evcM6P3pKd9GwkrOhHT ftFtlPasu20is7/vF4U6CZ/cCzOQUW+zf3UbGOSwIE9d9EeN1n1HNWULpAli+tazIFmc 1+GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170906654500b0084c950a7956si10053761ejn.144.2023.01.10.13.05.35; Tue, 10 Jan 2023 13:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbjAJU4x (ORCPT + 99 others); Tue, 10 Jan 2023 15:56:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbjAJU4r (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 231033C3AF for ; Tue, 10 Jan 2023 12:56:45 -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 1pFLfk-0001pw-9H; Tue, 10 Jan 2023 21:56:40 +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 3/4] staging: r8188eu: remove unused function parameter Date: Tue, 10 Jan 2023 21:56:25 +0100 Message-Id: <20230110205626.183516-4-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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754671097166259504?= X-GMAIL-MSGID: =?utf-8?q?1754671097166259504?= The regs parameter of the usb_write_port_complete function is not used. We can remove it. We can also remove the macro to hide the regs parameter when usb_write_port_complete is used as callback function for an urb transfer. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/usb_ops_linux.h | 2 -- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/include/usb_ops_linux.h b/drivers/staging/r8188eu/include/usb_ops_linux.h index 966688eedf66..e406a1fccda7 100644 --- a/drivers/staging/r8188eu/include/usb_ops_linux.h +++ b/drivers/staging/r8188eu/include/usb_ops_linux.h @@ -19,8 +19,6 @@ usb_bulkout_zero_complete(purb) #define usb_write_mem_complete(purb, regs) \ usb_write_mem_complete(purb) -#define usb_write_port_complete(purb, regs) \ - usb_write_port_complete(purb) #define usb_read_port_complete(purb, regs) \ usb_read_port_complete(purb) #define usb_read_interrupt_complete(purb, regs) \ diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index 7da13b87d726..3fd080091340 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -35,7 +35,7 @@ void rtw_read_port_cancel(struct adapter *padapter) } } -static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) +static void usb_write_port_complete(struct urb *purb) { struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context; struct adapter *padapter = pxmitbuf->padapter; From patchwork Tue Jan 10 20:56:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 41654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2969783wrt; Tue, 10 Jan 2023 13:08:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXt4vK1u0xtvr4bKrbWc6qCkshG4y9Uo1MqucSpkXc8lTjNF0R8PbUXuZMvSSu7H9ZsKDT7i X-Received: by 2002:a17:906:2816:b0:7c0:d452:2e74 with SMTP id r22-20020a170906281600b007c0d4522e74mr60271238ejc.4.1673384891691; Tue, 10 Jan 2023 13:08:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384891; cv=none; d=google.com; s=arc-20160816; b=ytB4d+ZweCGu6JU1w3JyL6GeSYnMivQFw2+KXOTAuuXidHHSxLXddclA1YtL68jdRu 0FOdZ1udfzayzTQZ1WrJIRfbjocllRjp5kHoWhR8mfRiy2Z5UM9Fqjf3T719RtSEaOFH PY9ph2UbAPZIL8/3MOh25gMMwrbtaEV8RuWgg6ApQMRpTw+ZEE7kBBXWj67sEhofo3SH mywMDfmothkeIiFqHMzfgcAdCAiarcroRCi6eIdkbEZ4xOi53TmiCAY5hSwrmeLYBI8y BBpWHzaEjtrPJSKaYrOGC2oGjeISvHBAKQ1wwFZ4rzsAdtzZm2TzKkqapE5gIXnRie6B /BCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JwWJFYLSd2CQWw/zaAQ5yw40Gca1r5k8HEaEV9iwZO0=; b=CxEBzBwclN7RjS/QcSXoILW/U4zL+K4PhVX4KJ3BL22if6j9kUgeXLBxfRL+uEduG+ znUYo7wJhbCMbosTxjhht5LGyfFtlIuVTsVwEZJSegSStrh5/O8qPqC2i2qgKRZD7DOW +hHloUp8Wc5wv1MlFN1TAAkgDN/6vH2erJGZ81k20mpClXFx19wOn9dZabeLmGfO0zzL xzbB1n5IYKa/xZ4BtXPkTJN34G2+vMgYSNg9ogx/ny8ooWo6ULmE5SFhPTnC4ROB9FGk tCUNWBbflnWyWb63r4ZTAReTJwh+cDMLJlrJZYBpj4wn3i2ygqfwCxOjjVnbqh1gG8mn KVxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wv1-20020a170907080100b007c0c5cb19f6si12465655ejb.684.2023.01.10.13.07.47; Tue, 10 Jan 2023 13:08:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234109AbjAJU45 (ORCPT + 99 others); Tue, 10 Jan 2023 15:56:57 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754671236042452607?= X-GMAIL-MSGID: =?utf-8?q?1754671236042452607?= 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/staging/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 == HIGH_QUEUE_INX) rtw_chk_hi_queue_cmd(padapter); - if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->bWritePortCancel) - goto check_completion; - switch (purb->status) { case 0: case -EINPROGRESS: @@ -63,7 +60,6 @@ static void usb_write_port_complete(struct urb *purb) break; } -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);