From patchwork Fri Dec 30 18:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008392wrt; Fri, 30 Dec 2022 10:08:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoZ7O8w2lEaczI7QnqrirBD1VeGpTqhF7PBn5kmu8DsGu54Y3oVH31c8i7/KronMZCWeti X-Received: by 2002:a17:90a:9304:b0:223:fcc8:d7dd with SMTP id p4-20020a17090a930400b00223fcc8d7ddmr35747317pjo.30.1672423695974; Fri, 30 Dec 2022 10:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423695; cv=none; d=google.com; s=arc-20160816; b=FIEB8ZokLuWDwWSGhiZmpUS7K+rSbiji1lAvWFJIaFLAbnm9DlHUS/T1VYZlLA6C/2 hVvVYHWvCgeAn57LjLIDN87dNeb9rKwzryKDpT2kAh0CNJlM7Nq0VnV734TGqJu3kyk5 tYscVwkSQqA0x1uTv0fx/Whpr8T7AO6PHkscEsMeo2TGjVAv4HmGmbkZ8rGEYCaPflb2 jTV12CIB06vMQDTloJkAEXzBCd93qaUUJk/bJQYB6zpzgbpjw+xfyA4+3qec3UOfOEz/ ew/79QxRkV8UnqPMy1rvTbEh14S6D9zzJ5fFtofakybr8ZIW4QTRkQnLE9UM/1EAC+bx 5oWg== 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=rLMTyswHMdazjWN3u0Tm9OUy6TD5valgeQaae4MY8bE=; b=ZNysHplHz4tMQHbVc9kPsCfbXw+ZuUrbiO+e3kRsc7fF0XkonmifY2TrocCo+oQZga p/XmfFr1Xax4spZS1Ok0dObib71+laIAFVtghKptAov1O4/K4A9+ZomCHPzANK+5eA0f e8GhNJRLjwqV1lDKpQiWtUH/tBR5PUERy+xIWQ849WZGbylteuHJi/NOTC3cHsHQjS4q LWxIm7Gj7BtUHuMEYbWWL0uZBzo7vMAAcl8vKd9TrCMW8xpWXZmSSQWn6B19yoQGQZQB z4oqO4e8ozha3cIMh2dMG5EhrzlUHzRTIZ5qRG0UEIOU622BJpPkQp24BB7+Kklkj1JZ Tsww== 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 rm1-20020a17090b3ec100b00218592c28casi27777564pjb.33.2022.12.30.10.08.04; Fri, 30 Dec 2022 10:08:15 -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 S235475AbiL3SHf (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235432AbiL3SHR (ORCPT ); Fri, 30 Dec 2022 13:07:17 -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 AFF1E13F05 for ; Fri, 30 Dec 2022 10:07:16 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmg-0004rR-Oj; Fri, 30 Dec 2022 19:07:10 +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 06/20] staging: r8188eu: simplify rtl8188eu_xmit_tasklet Date: Fri, 30 Dec 2022 19:06:32 +0100 Message-Id: <20221230180646.91008-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663349509742579?= X-GMAIL-MSGID: =?utf-8?q?1753663349509742579?= Simplify the rtl8188eu_xmit_tasklet function. Remove an unnecessary temporary variable and reformat the code. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_ops_linux.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index c51f860d3527..a238d29a3a46 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -481,22 +481,14 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem) void rtl8188eu_xmit_tasklet(unsigned long priv) { - int ret = false; struct adapter *adapt = (struct adapter *)priv; struct xmit_priv *pxmitpriv = &adapt->xmitpriv; if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY)) return; - while (1) { - if ((adapt->bDriverStopped) || - (adapt->bSurpriseRemoved) || - (adapt->bWritePortCancel)) - break; - - ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv); - - if (!ret) + do { + if (adapt->bDriverStopped || adapt->bSurpriseRemoved || adapt->bWritePortCancel) break; - } + } while (rtl8188eu_xmitframe_complete(adapt, pxmitpriv)); }