From patchwork Sat Nov 18 08:52:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 166475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1064971vqn; Sat, 18 Nov 2023 00:52:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFy5GlaQ7jE9pF+03d84TNiTyrFmCRdT0GBFULtpQ+7m6SCeDbSa0nF2iLNk3F5ZuwT/ez1 X-Received: by 2002:a05:620a:1d05:b0:77b:9a8c:b0b5 with SMTP id dl5-20020a05620a1d0500b0077b9a8cb0b5mr2183806qkb.57.1700297573518; Sat, 18 Nov 2023 00:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700297573; cv=none; d=google.com; s=arc-20160816; b=dhz7SGoUVpefXxU6cHg5H5XqieaS7gVMmpi5+XsTpcEb5PQ0BWIkSIe8BGpLpgA1po H9ETFDrOgV90TlQaCrJnhgBSu4dg/HHiNuHMMdDzyrf1ppFwoA7okWRtklwIgogVD6et TN69YvHQ2BOt3XsUBcWiH8Ug6ayI5J5yn7EKFfLNXPsGrIYXJXmi81NJYRqgAbuVhvT6 hcNf3tXKL9D6kjRLL0pZDighrb/dx/ljdT7nefxvcBHjaCjRQVHX87hRJ5XZbhZxxYy1 rjN48LbShy2X2vNMVEB3qTco8pqpcqeLjx7M3lC/zNOXkh+ggekj/YgwfDxD3koSAe2G x1IQ== 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=zMz8/s0f1rrtzmkkOs21rTHNKe3hKx+usDsY/Vx3Y2c=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=iV1dKbgpgUdZcEX5pXSg4cZVeVJP1KkMKaIPecbb1qUgJNfjuQ04pJatAgWPeTjn1H YbMv4J6b73R5DzPsCn0D33dDDNUIqNIxaZePAQOsnq0USA/nwp1h34pRYchLcQW8DiUt DKomaS458MtFkH1BZTgAYiSKqgi3eSZ2QQOsJ3OqNUivgJjWor+tF/5HxMDQdFW5s3F6 Sli3qRaY7ekTDT7dDQryMYiQqsFFaXSJOIF1ceJh9uRUQaQ2os3Unl1RIMEqUf2AyZcJ 2RvQSyCb9s0CEhWnibCWq/fYBXrYhvZxn4PCDF8JyvfI6u2h7JH5JouGdsG4AF/378tw LjxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Fha9DYMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o15-20020a634e4f000000b005c2188ccb4asi1920065pgl.698.2023.11.18.00.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 00:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Fha9DYMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5AB74820BCAC; Sat, 18 Nov 2023 00:52:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232920AbjKRIwf (ORCPT + 29 others); Sat, 18 Nov 2023 03:52:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234695AbjKRIwK (ORCPT ); Sat, 18 Nov 2023 03:52:10 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D1B1BC2 for ; Sat, 18 Nov 2023 00:52:04 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9c40c3814a8so83405466b.0 for ; Sat, 18 Nov 2023 00:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700297523; x=1700902323; darn=vger.kernel.org; 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=zMz8/s0f1rrtzmkkOs21rTHNKe3hKx+usDsY/Vx3Y2c=; b=Fha9DYMnpyvw5Qp3D/VxO+DLEGbH/9zlSFfFXHCsjM053+Go/QjIonvIqu/Sbx3uGW tNjwJsmA7geF3+qxEG4ciTbwUX7PaSHXETZ35NJ4HMkkW+4hn6Eg6Xs75Sg28Jl3+X16 91WYyS9s0OiXD26Ac1vjbHvVBzTR4lcCcCYbaxhQMPgMywe96D4a9ke4yfqZWTtd85ig Kg9rsJNDRnV3VFJi2gHGGFS2oDfoYUJOHDf/rlB+a6MiM1Z6CNjcW/7tK/PS3I8qbxut Qp40jhIgOjibqyIi9SSaplmXSl/yGo3Y8HzyreHgIBvsYW3zClcUA7UKc1MtoaRBRr0q lphA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700297523; x=1700902323; 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=zMz8/s0f1rrtzmkkOs21rTHNKe3hKx+usDsY/Vx3Y2c=; b=FUhpaNTWq12O2qGLhHKNv59i8gLhBBd9zGyrpCUQ44UTYpKlkYq2OXhJkYDPIXBP+0 Z7zutlIfeUwG20S0w6/toIFYm+7dZ5QJe9euB/7/t5PUjscg6EWizYkz0WODD+XpiW7A 6tHOK/1rqejKQsH+j6q/pNJS1RPojc81MG7FLyPdEpfU/pk6Oc9/gsBYB8+A6GFh5giY BROF38uoppTuneQv1KX03HWeZB+6fAgGH8Nkg5Ex6Pv2orTXXD6wBe41k63jAge/OX3f DphbeDOgUomqMfFq5UTgMaJFYmmyWNoWFLT3aj0K1hOmwGStEIN3fKnYwZrIET62WwcM nzzw== X-Gm-Message-State: AOJu0YxLn073YSaFIW+eRHKeUYLzcKDEWT66DkTzkHLEK+NB0IorRP6s nxwIm11HgnXw8OMb+Bu0Ii8= X-Received: by 2002:aa7:d755:0:b0:547:da7:9c10 with SMTP id a21-20020aa7d755000000b005470da79c10mr1261003eds.2.1700297522916; Sat, 18 Nov 2023 00:52:02 -0800 (PST) Received: from matrix-ESPRIMO-P710 (p57ba2f20.dip0.t-ipconnect.de. [87.186.47.32]) by smtp.gmail.com with ESMTPSA id g22-20020aa7c856000000b005487d3fb436sm202605edt.90.2023.11.18.00.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 00:52:02 -0800 (PST) Date: Sat, 18 Nov 2023 09:52:01 +0100 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 09/10] staging: rtl8192e: Remove switch for a constant in dot11d_channel_map() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 18 Nov 2023 00:52:51 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782891228486157107 X-GMAIL-MSGID: 1782891228486157107 Remove switch for a constant in dot11d_channel_map() as the result will always be the same. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/dot11d.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c index b515008045bd..37106fd54f00 100644 --- a/drivers/staging/rtl8192e/dot11d.c +++ b/drivers/staging/rtl8192e/dot11d.c @@ -62,24 +62,9 @@ void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee) [channel_plan].channel[i]] = 1; } - switch (channel_plan) { - case COUNTRY_CODE_GLOBAL_DOMAIN: - ieee->global_domain = true; - for (i = 12; i <= 14; i++) - GET_DOT11D_INFO(ieee)->channel_map[i] = 2; - ieee->bss_start_channel = 10; - break; - - case COUNTRY_CODE_WORLD_WIDE_13: - for (i = 12; i <= 13; i++) - GET_DOT11D_INFO(ieee)->channel_map[i] = 2; - ieee->bss_start_channel = 10; - break; - - default: - ieee->bss_start_channel = 1; - break; - } + for (i = 12; i <= 13; i++) + GET_DOT11D_INFO(ieee)->channel_map[i] = 2; + ieee->bss_start_channel = 10; } EXPORT_SYMBOL(dot11d_channel_map);