Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp2063681rwj; Sun, 30 Oct 2022 10:36:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mkcQ7MJRJ57NKLpL9t5YYrL45DVPYRGi2i+LjYFolypOkqrM2RMg3pFu8iu+mkhxa6VSP X-Received: by 2002:a05:6402:428d:b0:460:b26c:82a5 with SMTP id g13-20020a056402428d00b00460b26c82a5mr10080702edc.66.1667151394112; Sun, 30 Oct 2022 10:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151394; cv=none; d=google.com; s=arc-20160816; b=G4oAsfDnpE6rPB1/i51MRn7CsinYdCmaCWafvvKb0TxpDPYqmNg9oYlahqPSxGuFQY FlmQbiaFbCoOMhKf9SsuEuSD/aR9NIIp30xHAUjXMwCuSTY0vyYpXMt8P6eaKX6puvhj pxUJXiEP9zfrrP1UR9/j1+k+nMkfGyO3uoj+a9RiMLaeRAtpHoTUdzoEAYnHBX1r0p9v dGthX4Ja2UubzJWpIviEVeqJIpHjpAZBFByFJNm2giJqpfqNNovaf3dJDqtW0iDMibSN 7DFS7OsH1E0GJxTNqXvCefXWFgOEu3uoic8iITQzgiMMF8bRfIEPkvx6D744TqMnxOWT VwkQ== 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=LjbJ83QlYCGAMKrFsZiaXWMAkA3amwSSLm0aE5hONyo=; b=WGkiyXJKJ8/Eeb/48/QmoNfSrz6sf8JVBnePyXmqc9XZSYgQ+uUMgAawn88F+Lh7hI sTCTNQwFvMr9pCZTfGtnID6niAU1XWqseDHmXihMJY5a4YeFGbzoHIGR2YVHgi8gJjzq 3rUYGRXCwVQzNZcFtKMVCHTbA+yUDhBK7FWW+sBDVhkJZCHG1Mbu9gVUztttceOUvwLI saKNV+8EkvOg6L+MhZ/5u3TW6zSiArMV2rDKQg5Xo6wusND2ZAG+EX0ZgGR5phg99sMR QIh+fLavgs83OVAtTZniedu4xhDbLk+IyPppq4h0Hj1A71nq27UVMBf5wJwyQpNxajMH mNCw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p23-20020a170906141700b0073083c63edcsi4672994ejc.306.2022.10.30.10.36.09; Sun, 30 Oct 2022 10:36:34 -0700 (PDT) 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 S229934AbiJ3ReJ (ORCPT + 99 others); Sun, 30 Oct 2022 13:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbiJ3Rdv (ORCPT ); Sun, 30 Oct 2022 13:33:51 -0400 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 5E4F4A44E for ; Sun, 30 Oct 2022 10:33:49 -0700 (PDT) Received: from ipservice-092-217-067-184.092.217.pools.vodafone-ip.de ([92.217.67.184] 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 1opCBu-000469-Et; Sun, 30 Oct 2022 18:33:46 +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 v2 07/13] staging: r8188eu: replace switch-case with if Date: Sun, 30 Oct 2022 18:33:20 +0100 Message-Id: <20221030173326.1588647-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221030173326.1588647-1-martin@kaiser.cx> References: <20221030173326.1588647-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 OnAction_p2p has a switch-case statement where only a single case is handled. Use if instead, this makes the code shorter and easier to read. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index efcb2f3b6d3f..64d01da9c814 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3852,19 +3852,8 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram len -= sizeof(struct ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; - switch (OUI_Subtype) { - case P2P_NOTICE_OF_ABSENCE: - break; - case P2P_PRESENCE_REQUEST: + if (OUI_Subtype == P2P_PRESENCE_REQUEST) process_p2p_presence_req(pwdinfo, pframe, len); - break; - case P2P_PRESENCE_RESPONSE: - break; - case P2P_GO_DISC_REQUEST: - break; - default: - break; - } } static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) -- 2.30.2