Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp777882rwj; Sat, 29 Oct 2022 10:38:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zCpyHqv2Nnx1VzU03oSqVCeOOW9KoYxFLsEUcnbtGvk/vyARv7Xcpqt2YxZoApGNYXvjt X-Received: by 2002:a17:902:be0b:b0:182:fd6:1293 with SMTP id r11-20020a170902be0b00b001820fd61293mr5358627pls.146.1667065112047; Sat, 29 Oct 2022 10:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667065112; cv=none; d=google.com; s=arc-20160816; b=a+BqM0zGddpFg8GissSs0okOQAv3oWYBnrdeRd1q8FE1JOlYKT1s+bfYCPQP+zgYEv GdwzhUpoYVFo62inThhKAXGNJG2Ka25kJsvptzkKs9E1nm2+LUe4lC3L0UqW6UnoU7Qs DNYHArjVcyGqZ0ObrcIrR0gOO0UmjrmYsErSZpeztJiEwmoT7EVsnmY1tXBQW3o0uhdI 8XMZcLhcfMk4zXPoSrWxAkKZtR8uG/dlkCq2JHUbLDIhGS8Yrk1aB1J8/LEM2ef1VeRb 0vhW2HHR0nOtckmX5DK5fKkLBGRX2QR6SBfJE7a9S+Z0ohxRkaUs1e3R0r2VySV1BlGU 2tBw== 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=E5uDM+O5N2X5f/xg1N3gADhUuYgG3v2KYKPJKNaBQOU=; b=UMd1lbUL3EMjh6+pX7xEM9J23mEULgQtkLvJqzEIUQYTa30mjzNl+S8ua1xwkAACiy mxT0uYOQvKlRigGuukzLyfTgzm5KDiYJ4+Wumreu8VciyajM6VMrZVFsUXag1aTuTfJu ZYd4vfoXx0Gmp1Bjd+3JjSrozdpXD17Fj63FIdaWOg+ge6s9tqHBFSPdPJX7N2ZTL8qk f9l2/pCN9G3a6XV7U42XTMfOzZLgvKuXmUwON5sLzWS+vlxIHH7dggqcpaVofiS98Z45 qOT2XxkKBzBu/Y30IG8pRuoSgGVpRVo4NnzcZ2v5Id6mg2Q7miFUHuszJdoPnhGl79l3 qt1g== 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 n2-20020a170902e54200b00186f2ef80bbsi3116573plf.308.2022.10.29.10.38.21; Sat, 29 Oct 2022 10:38:32 -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 S229944AbiJ2RY2 (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiJ2RYK (ORCPT ); Sat, 29 Oct 2022 13:24:10 -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 4C59541514 for ; Sat, 29 Oct 2022 10:24:02 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYs-00074v-RW; Sat, 29 Oct 2022 19:23:58 +0200 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 07/13] staging: r8188eu: replace switch-case with if Date: Sat, 29 Oct 2022 19:23:31 +0200 Message-Id: <20221029172337.1574593-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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 97bcef078ea2..7b05f847a8e6 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3853,19 +3853,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