From patchwork Mon Jan 30 19:53:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 50451 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2367803wrn; Mon, 30 Jan 2023 11:59:07 -0800 (PST) X-Google-Smtp-Source: AK7set8yWYGtONtk0klkWPMfNQmJu7Wd0gR1ppMdXt5N7cTkxYJHKvplSeV2hVH/VDQ24VlJyRTt X-Received: by 2002:a05:6a20:6992:b0:bc:f035:4536 with SMTP id t18-20020a056a20699200b000bcf0354536mr7464421pzk.8.1675108746724; Mon, 30 Jan 2023 11:59:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675108746; cv=none; d=google.com; s=arc-20160816; b=DHoWO3NgLpJ8G5RDD0fFendqXHcBsPPvMGLZIL97hBe+cFO894e03ftQQq298XoS5S 2+ml0cCw7N4YLL2w7GkDRKn6KddiEY23N63DX+sjbGhb3v88DMOPXLLa95Fe4jozi3mK 6xwQtRJSzZrHMRwsW+LwPHxpTUJ9NsJh4GwDK7dyaDZ1cQ75Q7/S76X8PiNVJ0RnPip1 4Rp8Zf1KWo5S6T/jIJVZbVeP95WfZm3AZVcNrfsw4j9grF8YLhKDAtlwoxFgwlv/TtM5 USZ0jQBL5RZRhIHx7+UodzUrh+M2Rze50dmyB4qG+lvVJHXwCXIww55uji3xmgIozoiM 9Glg== 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=+uaeG1bCMEjFHyRxcgB3iq8q/OOhDkABwQYluU1q5bw=; b=h8PPlCVj9G2ys/Wm7IXvIeKVVxKXjpVRrycsnsaJrhgRL8Do/52XgezH6NAOpEE4iE MWf8uTSmlYYAR1xUod5k5O9bFPuesGeRCUucZHoRs9aOf6N6MibK8yT5zxFs9OXK5srm jsU4wZEzkkycM3vEzJ4nH8fv2qFu+exzi+MVvXH6obcvtjjXhc6N9rq++VIkvG2wqPBN vagW6yM1uZo7uLIJGlq2GIfS0PM0pXLucg2ZMsBcx5j3pdBD8SV2JP7Q+qkdjQMe6GpW JoopwhcMOSmUnvP0FlceKmfUqfsyJV3gBeX2SssoWTpUjaDYKqo3ZYsKxGY7wNjO9tkf iziQ== 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 bs65-20020a632844000000b00478e15039c0si12916561pgb.779.2023.01.30.11.58.54; Mon, 30 Jan 2023 11:59:06 -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 S238235AbjA3Txy (ORCPT + 99 others); Mon, 30 Jan 2023 14:53:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237949AbjA3Txb (ORCPT ); Mon, 30 Jan 2023 14:53:31 -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 93F04CDC2 for ; Mon, 30 Jan 2023 11:53:29 -0800 (PST) Received: from dslb-188-097-040-029.188.097.pools.vodafone-ip.de ([188.97.40.29] 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 1pMaDS-0007S2-Q6; Mon, 30 Jan 2023 20:53:22 +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 9/9] staging: r8188eu: replace switch-case with if Date: Mon, 30 Jan 2023 20:53:03 +0100 Message-Id: <20230130195303.138941-10-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230130195303.138941-1-martin@kaiser.cx> References: <20230130195303.138941-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?1756478829181349727?= X-GMAIL-MSGID: =?utf-8?q?1756478829181349727?= Replace a switch-case in rtw_write_port with an if statement and make the code a bit shorter. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index c9ee1173a1d6..48c96f731ce1 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -121,14 +121,8 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem) status = usb_submit_urb(purb, GFP_ATOMIC); if (status) { rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_WRITE_PORT_ERR); - - switch (status) { - case -ENODEV: + if (status == -ENODEV) padapter->bDriverStopped = true; - break; - default: - break; - } goto exit; }