From patchwork Sat Jul 29 07:53:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 128086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp942848vqg; Sat, 29 Jul 2023 02:57:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlEiTclUWmdsYHUqN6fNWb739IRpYDWgFg05rpF2LSDuCUp4HuHnkKn9LjZ7Sd+glu8f/hbj X-Received: by 2002:a05:6a00:2185:b0:682:4ef7:9b17 with SMTP id h5-20020a056a00218500b006824ef79b17mr4449129pfi.32.1690624665204; Sat, 29 Jul 2023 02:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690624665; cv=none; d=google.com; s=arc-20160816; b=mTAPQn23linVm7ZsaIgLXCDIRBgyLgJvnoCnZnlPpi3lQyQCNaToeutrZH9/U+HH32 mt90jL1lsv1B9IktyTgiKjjaWwRBFhEQzA0sh59Dt1QjdSI1FrfRNMvqWgEVtXfpRcR+ reBoI/4ihFRjrCdpvz+mquzw1RSZWyeRGcnhuh1sTiI8qpWSt/Mi7AR3XQztJyfQMZow g/V/2IvTh5/SQvGm8T5YnWWPJropzD6h9z3zrYlo+30Sguv6katAt77OvWMFbetKP5hr VhHvjnHv6iZkzcPODayprD5PCDbw3AMR5WOfm4JvpO/X4vYgQKKdNc9Bj2TlnlmgK4pp yApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=jZTouIE3bYlS4ML1ECutlOlFs3Ssf3ayt3aS6iRC8mI=; fh=1cdBMIz85FPYRj3yPieCu5zLx1nt70pcoGPlugZXEIc=; b=P1tLPnnwj8RhvZuchpVNDz8AegaDqQtN5ZqgsRo8znub+qZuo6A3VTwl34H86RHtLx /J6l1YHH35wPoYs+u8mjcCG2D5u6d6RoVrkq8LIqZQjtaHtZtLtGV1gNSduhMpV4BFAc 6BSOKYchHQ4KMm5vKo68RE7UoUC3DGAp3RO78lQfnGFbvkbMyJuM6NU1xX5wwJuQdjlG os31n+UHtaN1o0HXjtJNYjOTkmneEAnsAyk9oA2+pPXnstXB/rlbj14ZGWvu8LkK5Fd7 fOJgI1Erln6/kG6kMyBdvSapD1WEX5k59Id5Jog7GEXBf5jTT/ubViglNU1RL9K0smvD 5gCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="SNnlPt/B"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a056a00140600b006821425440bsi4446723pfu.279.2023.07.29.02.57.31; Sat, 29 Jul 2023 02:57:45 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b="SNnlPt/B"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbjG2HyP (ORCPT + 99 others); Sat, 29 Jul 2023 03:54:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230292AbjG2HyK (ORCPT ); Sat, 29 Jul 2023 03:54:10 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AE45524D for ; Sat, 29 Jul 2023 00:53:52 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-991f9148334so71549466b.1 for ; Sat, 29 Jul 2023 00:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690617230; x=1691222030; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jZTouIE3bYlS4ML1ECutlOlFs3Ssf3ayt3aS6iRC8mI=; b=SNnlPt/BeIx4nHo/DW+/WEZl95UmgkWw3HxVw3ohC1u6I2aqHINyLLSeQ8FuJPf6lT ky/AmSBcFUMTCeThqK3KbKQS+Ppwup1zwP9H+ymvjtMkJDpG4pZyZ+T3VbmZoUYaaVS+ 70czk8zHc0kQaL3kUlchsLIwDROJv/69OAo9gcUPRhDXelRk/TCk9GZvab/9WkdU/kwo rzJHD2IYkGQuzPXwI4BFjxCApj7Baw8ox86sDJEl/RPpEQyZ9x2CncBWksBr/xaS1tgX Ndq2qgWj5IjnSZN7wwOqrhnz9LVDZxhVWkyTy+ctTAuuzZUmlmgoXGfElD9MfoEu75yB wGSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690617230; x=1691222030; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jZTouIE3bYlS4ML1ECutlOlFs3Ssf3ayt3aS6iRC8mI=; b=k43NFz2NOEBMclV+FxfxPJ0FyRgrcp6YqL/C09C1e7Vgw5yiI4Ak59XvBe8lY1vMMQ aOjY+tlHnvc0HQ6tckoa+K9YsRTpt8bxa8EaJBkActbvz64phz5qV6y31E9AUBIK/xI5 KgwK/3cVGr7UMt7chS1yhDUzs3Qgu6zvp/z8u+uLio6R4s6bnEYYUNlrZLzgfC2cyj56 HTgCQt5soXWhgKVPAeSt/G0kx6kHowBAvJQkkKoKh9nLybw3saHuuy3R01nxhO0A0MyL 2/qV6umrvosV4fF2vu2sLgM8y/Uyk2RqgRUL18XKamOrGpfE9/WztMNB9Huao3l2zgqs kfWQ== X-Gm-Message-State: ABy/qLaqqVD11uhsEr+u12FW9MiNnvAQEgStnOnuhBVFK0s/xRB3XtqG 70rRaLrrDYPu6Jp52BKI8cocSncBU/k= X-Received: by 2002:a17:906:73dd:b0:998:bac1:3bdd with SMTP id n29-20020a17090673dd00b00998bac13bddmr1353725ejl.2.1690617230519; Sat, 29 Jul 2023 00:53:50 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p57ba2e0b.dip0.t-ipconnect.de. [87.186.46.11]) by smtp.gmail.com with ESMTPSA id i10-20020a170906250a00b0099304c10fd3sm2982067ejb.196.2023.07.29.00.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jul 2023 00:53:50 -0700 (PDT) Date: Sat, 29 Jul 2023 09:53:48 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 09/10] staging: rtl8192e: Remove is_mesh from rtl92e_set_swcam Message-ID: <5d324977054f3a27b89c5c73da82e9c01c6dca45.1690615475.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1772748449215410871 X-GMAIL-MSGID: 1772748449215410871 Function rtl92e_set_swcam() has parameter is_mesh which is in all calls 0. Remove dead code. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 16 +++++++--------- drivers/staging/rtl8192e/rtl8192e/rtl_cam.h | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 10 ++++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c index 6d9e5c27017d..f9ddb8384752 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c @@ -50,7 +50,7 @@ void rtl92e_enable_hw_security_config(struct net_device *dev) void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, - u32 *KeyContent, u8 is_mesh) + u32 *KeyContent) { struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_device *ieee = priv->rtllib; @@ -58,14 +58,12 @@ void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, if (EntryNo >= TOTAL_CAM_ENTRY) return; - if (!is_mesh) { - ieee->swcamtable[EntryNo].bused = true; - ieee->swcamtable[EntryNo].key_index = KeyIndex; - ieee->swcamtable[EntryNo].key_type = KeyType; - memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); - ieee->swcamtable[EntryNo].useDK = DefaultKey; - memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); - } + ieee->swcamtable[EntryNo].bused = true; + ieee->swcamtable[EntryNo].key_index = KeyIndex; + ieee->swcamtable[EntryNo].key_type = KeyType; + memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); + ieee->swcamtable[EntryNo].useDK = DefaultKey; + memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); } void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h index 1ebd92e27441..fcfde5f6cf2f 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h @@ -20,7 +20,7 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u32 *KeyContent); void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, - u32 *KeyContent, u8 is_mesh); + u32 *KeyContent); void rtl92e_cam_restore(struct net_device *dev); #endif diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 74747348b573..644762f925b7 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -712,7 +712,7 @@ static int _rtl92e_wx_set_enc(struct net_device *dev, rtl92e_set_key(dev, key_idx, key_idx, KEY_TYPE_WEP104, zero_addr[key_idx], 0, hwkey); rtl92e_set_swcam(dev, key_idx, key_idx, KEY_TYPE_WEP104, - zero_addr[key_idx], 0, hwkey, 0); + zero_addr[key_idx], 0, hwkey); } else { netdev_info(dev, "wrong type in WEP, not WEP40 and WEP104\n"); @@ -857,21 +857,19 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, if (ext->key_len == 13) ieee->pairwise_key_type = alg = KEY_TYPE_WEP104; rtl92e_set_key(dev, idx, idx, alg, zero, 0, key); - rtl92e_set_swcam(dev, idx, idx, alg, zero, 0, key, 0); + rtl92e_set_swcam(dev, idx, idx, alg, zero, 0, key); } else if (group) { ieee->group_key_type = alg; rtl92e_set_key(dev, idx, idx, alg, broadcast_addr, 0, key); - rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, 0, - key, 0); + rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, 0, key); } else { if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->ht_info->bCurrentHTSupport) rtl92e_writeb(dev, 0x173, 1); rtl92e_set_key(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, 0, key); - rtl92e_set_swcam(dev, 4, idx, alg, - (u8 *)ieee->ap_mac_addr, 0, key, 0); + rtl92e_set_swcam(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, 0, key); } }