Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4420566pxb; Mon, 21 Feb 2022 21:03:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKYdFyJQwqEsh0RP0IE+ctxt4zSeDDsbUn+YWFlVCLQ7T5EryrSrhPlsz6JRzQDcO8ApQ9 X-Received: by 2002:a05:6a00:134c:b0:4c7:9893:3452 with SMTP id k12-20020a056a00134c00b004c798933452mr23206058pfu.37.1645506223446; Mon, 21 Feb 2022 21:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645506223; cv=none; d=google.com; s=arc-20160816; b=XLn7eQM/cP9q8grK13cFOJkT4ZEoOMrvJmt7PFZGts8259XLg2Gx1JoBrhvqH91Uej mUVQSc6TbS26smWR1s7jAyL0bwQpd98FQFXsniEhGDuhGnXfK9HwSrdX2FLvUyqq0fDG 7VNpSlIw26f3dvUco7xNs6iQyIlXxi6UUUjVs6OdDfOb2emZJXDih1RZKHnuvUHPrHRV a3O+rVsP6+YCF6bDUAEywRtj9QFk/YkTWkmGDvLVKWCbbU1pJ1iadxW3hPkOo0QLHK9+ zZHx3vn9rocOuy96ke5+CQuNsZhtG6xj+DsZTRk8c5DRV05XbnoMfLCEsUo9+6PTOfcU el0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9O3/P6nDT9vew0ys+NqmJ/EyY8z22EgOFRFm9Et7xg4=; b=uTg47MHbsQkbPs0DL0Gz4+x7icwfKsJnQrJX0SnXXe6UzSomapGBqDRcGTtmQiVxit bfZt4Mws1QRKRwMxc4xJMlKOEkc4Rpx4WAmEkXa5QnsWBGWnsfgBrNpJWRNPgOH0wdCL 1SlwY4i8/JD3H2OmOcf/bVgC+1iHTPKufutWCa3xFRuQ09+AgAp7aSZoVYNQgAHN8gpQ giVUU8cCfE6wAgwEWtSkCCmnhM7952nPKSZ+weW+2BCUatveVlSVhSlln2ZyqOMBj/cG 4XPV8S/frEce3lo4ajrRdaQtyWWWKk1tbMrpscdkYs6S9i/xC8rOokVJ5mlnB/HyHLKR k56g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kG9GzAkh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id my11si1267917pjb.138.2022.02.21.21.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:03:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kG9GzAkh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 383C61EC7E; Mon, 21 Feb 2022 20:37:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234060AbiBUUzS (ORCPT + 99 others); Mon, 21 Feb 2022 15:55:18 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbiBUUzR (ORCPT ); Mon, 21 Feb 2022 15:55:17 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F83237CC for ; Mon, 21 Feb 2022 12:54:54 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id e5so20807924lfr.9 for ; Mon, 21 Feb 2022 12:54:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=9O3/P6nDT9vew0ys+NqmJ/EyY8z22EgOFRFm9Et7xg4=; b=kG9GzAkheiHFSYStMre7Sbd4nDnyVbI9S6lYxgznlRwabVMFV+6NYKe5C1y19RzNhi 9pYuMftc9tFm2b5WlMsD4f8nnNP3hCIFLYPKTztX1q8uodWNn07Th0yoPcl9CBixLcQi 9/CvZhL3Y0LcxON1qET6MGSGMSaDfzm6nGZA/DURDrvSbexXEjRxrpE2zkindlxpqUrE XBbUazcyXadWAo9tQuaGN5OPZc7XVPhYxNDW2u2eDcng08fSVvay5rZ7H9un2Yj1VE6g TIai1GiBhMuT2rCcT/CxuJe25C9YaToNXd5HL623gkQ0b0nmjgWMxw8G/u3ldHUYGp7f HqLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=9O3/P6nDT9vew0ys+NqmJ/EyY8z22EgOFRFm9Et7xg4=; b=sNQrUJYt5hA0HEsz4VAmvyT/BeQiwwtCxm+iQD+//JhAqzUTAG+CiuWiWOO4hHlOFy Wiq6woL+n7/+sHJ2tYi1EJQZVNHkOgro/tRFtglbxzRGpzh9ZiM1pQHQG3i9xBRKY91y o9eqwfHlRi8KoqtmzPZQWLDXtaCR1T+emh2T+nHeTiVwPWOrX3xVhsstePvM2wMyCdDq ALSGpSUHb6lKpy2JV4vPaUr8jf5U+30i1P3YiWsA8Lx7zn4vxEK9VQ3bUESFd7ufyKFt 5BBXLCfMm7kGsfeijI42+LC09MX9acm6QoYZzFOj05cEP7iOByh4teIk6J4l2iXJStS2 +/Ww== X-Gm-Message-State: AOAM532HcqSc7HdI/VZFVfTSz7k4gZGswARa0PxSduJyBe6GxUNTcwrT fzktbHKnq9pmviO2l7wDDxnXfhuOfc4= X-Received: by 2002:ac2:5e2f:0:b0:438:a4b5:4c72 with SMTP id o15-20020ac25e2f000000b00438a4b54c72mr15526215lfg.304.1645476892223; Mon, 21 Feb 2022 12:54:52 -0800 (PST) Received: from [192.168.1.11] ([94.103.229.64]) by smtp.gmail.com with ESMTPSA id o1sm1203816lfk.62.2022.02.21.12.54.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Feb 2022 12:54:51 -0800 (PST) Message-ID: <8d5cf235-27f0-9c7a-3659-d2b1fe7a02dd@gmail.com> Date: Mon, 21 Feb 2022 23:54:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 2/3] staging: r8188eu: refactor rtw_ch2freq() Content-Language: en-US To: Michael Straube , Dan Carpenter Cc: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220220154847.7521-1-straube.linux@gmail.com> <20220220154847.7521-3-straube.linux@gmail.com> <94160654-ec16-cad2-3cc2-46628caaa17e@gmail.com> <20220221122250.GE3965@kadam> <32a2b74b-f541-ddf6-d8c9-6bd6ca0ad07b@gmail.com> From: Pavel Skripkin In-Reply-To: <32a2b74b-f541-ddf6-d8c9-6bd6ca0ad07b@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Michael, On 2/21/22 22:20, Michael Straube wrote: >> I'm glad that Pavel noticed this change. This is a risky thing and >> should have been noted in the commit message. >> >> Just from a review stand point it would be best to leave the original >> behavior. >> > > Do you mean to leave the whole original code including the 5 GHz > frequencies? Or returning a default value if we have a channel value < 1 > or > 14? > IMO, your version is much cleaner than previous one. This table walk seems really unreasonable, since 5 GHz support is really redundant (I saw it in other thread) I'd put just sanity check and return the default value from previous version. Maybe even wrapped with unlikely() if we sure, that in normal state we won't hit it ;) With regards, Pavel Skripkin