Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp732726ybb; Fri, 10 Apr 2020 09:01:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJVWLA6mzbGpL+fP0qgL05clAslhWC0Oyq/gPHzUUgUHgYpjK4yFBYoHK/KVFEMPF1DLVpe X-Received: by 2002:ae9:dd85:: with SMTP id r127mr4522295qkf.58.1586534491782; Fri, 10 Apr 2020 09:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586534491; cv=none; d=google.com; s=arc-20160816; b=xOaNklxm9yPW7axp/SF80G1FAzai2AIFSRuFHTTfs2G8x+8rXEy0NUcMGNsSVLiCw6 4L6OTacGZFGTm1bNC0UX2DXZPG5bdwoIBghMi1db79DDnzfwiZu2NzFXXmynFnmyp3VN 8QjsEen9k4XLz8vc305PhWKc49P1RS8oKBegcxWwbuF2cCwZ/8ZjEiZCrlzqmiRfQAxC oR+uHzqqRBP3dNHfkl3xPH41DQcMjUMaq91DKrFxSIl26j1OXKFpfe/+4aN5BdCCxcwk 7c7GegXmploSsTKjWLRNA3usLhRmAAftJgW0KAAWLQe58I39aGd5n/3HR4YdWKjpBdzw 2/rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=VlTEaEE/Q3hcA+//l0aamYZhktqtjGx7i6zhMd4UZJ0=; b=zXyHVwP/SbYoOD50HUAS3GeFwbrgO8+w0jf/eG5AnBrHIDyRImaqG9T94vfzdFSiTL jty1c3ZOKVW+73Nlj86Urr0N9eJdEK3vDNPdNxsSjzsboQIJUndfP/eBkTsU/eaeoILP ap+TNTRIH35GDfrO/pJMyKmEHMeuVWK/YxpXp1V8TXV2FsICVvW0US2JEzEUyR97tT0M fZdSEDK2k3mN9bTB1FY/IwIUPWCNsiN2T8nKDicilUrr7SZNK15naqBizBUNWt01WLi5 EyDfBbL0f8ZB/LiQ9cvGsAMgeeDvJPWQ5P5n2m+IiiE0lxajEc/D3K+QWUxWXOoD3moB S/KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=AI8iO1se; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si1767386qtw.131.2020.04.10.09.01.15; Fri, 10 Apr 2020 09:01:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=AI8iO1se; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgDJP7a (ORCPT + 99 others); Fri, 10 Apr 2020 11:59:30 -0400 Received: from mout.gmx.net ([212.227.17.22]:45641 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbgDJP7a (ORCPT ); Fri, 10 Apr 2020 11:59:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1586534365; bh=1F93Ep3etTDE7a506QogajIZjQjOu07qM6i9ZlQqgik=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=AI8iO1seAAXv7gLlfOonQDJadbyZEEVwZ/KxcDsROwOqKIZKapwUomeZRtm71s62o YoGGCu84CYhUfWD9md3mIdDv8wnqs8o/XVj44eS1JfKli9ErJ9t96/kg43auPw2iuY HPg6VSGRh/GPZFxYAcppjn5jUuaDL1287kxVmlS0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([83.52.229.196]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MGQj7-1jUvkP48HV-00GoHi; Fri, 10 Apr 2020 17:59:25 +0200 Date: Fri, 10 Apr 2020 17:59:11 +0200 From: Oscar Carter To: Malcolm Priestley Cc: Oscar Carter , Forest Bond , Greg Kroah-Hartman , Quentin Deslandes , Amir Mahdi Ghorbanian , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable Message-ID: <20200410155911.GA3426@ubuntu> References: <20200410112834.17490-1-oscar.carter@gmx.com> <20200410112834.17490-2-oscar.carter@gmx.com> <986e8e5e-245a-cc70-2c6f-8ac3a4a485c9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <986e8e5e-245a-cc70-2c6f-8ac3a4a485c9@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:ou8M4Ssva0Szw+pYRlRW+QGxsgzYCNwOuEqt2DeZalYu9o6IK0t BbVvcNUZHNR0a31haR2XMfPU+3sL1v3raf0MQ0kPrWicL9JoyaKvZ75VOM47MI7QBvDJuY3 XL+JjN58HJ6ujvnyMooID3Oz4t/AjtctiNuY6T2uRYlAVQqFhzBEqkKSWNnHYV/nporOhKP bZKbxFeLoqFk/i0cn6wKg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9VV6u/D4l7Y=:mO2wgneHoaRuHlHrH/uy+1 BXUGpgMTrZi5hIfwjO+1wbqyJplB8rgr8dVLOHDGhUE++fluahrepCOUlSIpv7v9uJTaBaQTI EBNT6XLw3LNI/I2gq0vic4EMa1Ii/iGpwiTeFKrcZp+f+88K6nstfTTcFwY+cD40O3KQO4PGz kanEFarjWh1IQRRjQB54g0WGAOo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Vbq Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 10, 2020 at 04:37:59PM +0100, Malcolm Priestley wrote: > > > On 10/04/2020 12:28, Oscar Carter wrote: > > Create a constant array with the values of the "phy->signal" for every > > rate. Remove all "phy->signal" assignments inside the switch statement > > and replace these with a single reading from the new vnt_phy_signal > > array. > > > > Signed-off-by: Oscar Carter > > --- > > drivers/staging/vt6656/baseband.c | 101 +++++++---------------------= -- > > 1 file changed, 21 insertions(+), 80 deletions(-) > > > > diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt665= 6/baseband.c > > index a19a563d8bcc..47f93bf6e07b 100644 > > --- a/drivers/staging/vt6656/baseband.c > > +++ b/drivers/staging/vt6656/baseband.c > > @@ -115,6 +115,21 @@ static const u16 vnt_frame_time[MAX_RATE] =3D { > > 10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216 > > }; > > Actually you don't need the second values Great. > > > > +static const u8 vnt_phy_signal[][2] =3D { > > + {0x00, 0x00}, /* RATE_1M */ > The driver would never attempt use preamble at this rate > so it's safe to include in with the next 3 rates > > > + {0x01, 0x09}, /* RATE_2M */ > > + {0x02, 0x0a}, /* RATE_5M */ > > + {0x03, 0x0b}, /* RATE_11M */ > just |=3D BIT(3) for preamble. > Ok, I apply this OR operation. > > + {0x8b, 0x9b}, /* RATE_6M */ > > + {0x8f, 0x9f}, /* RATE_9M */ > > + {0x8a, 0x9a}, /* RATE_12M */ > > + {0x8e, 0x9e}, /* RATE_18M */ > > + {0x89, 0x99}, /* RATE_24M */ > > + {0x8d, 0x9d}, /* RATE_36M */ > > + {0x88, 0x98}, /* RATE_48M */ > > + {0x8c, 0x9c} /* RATE_54M */ > > Again just |=3D BIT(4) for PK_TYPE_11A > And this one. > Regards > > Malcolm I will create a new version of this patch and I will resend it. Thanks, Oscar Carter