Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp715794ybb; Fri, 10 Apr 2020 08:40:24 -0700 (PDT) X-Google-Smtp-Source: APiQypI/r6KCF/1TV2EvzHuyzAwvFiSXGfExbqbn5Rcx1ZkuXS3D+oRVyEo30m99vd75gTlPsmYW X-Received: by 2002:a05:6214:1933:: with SMTP id es19mr5676408qvb.186.1586533224510; Fri, 10 Apr 2020 08:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586533224; cv=none; d=google.com; s=arc-20160816; b=za8Yb+NUuSDG7gtsN55Kb7JHjg0OvQHM3gMDRtv8vG3EHZ/OACzI0VMqf7kMbdPp7n yQWEP/eeAB4HdGi8w4t3KBWVMY8EmamVrJwyyiOEG2h/O5u3aecwsA/S/iIbPFl3XlwL yZeTeYJxD4BOJdcBfBWAgOCiCJF1HDs9+AdDp44VZNNleXBn04/apmVnPnBZZ3HTbvsA LXp1F/fyKHLRFjbnwuJyV/BjG6IkJx7ElKZVywoYRSYUH0YETTU5FeZxmL/+gFddTX0X NC5OOoLKWg1w7et6TDUm+3q9XnJHvhBkQchoor+4iJ/wWROCQPPT0MrnZiWrXhTB8w2I 0zJg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=VBKczGYLsv2GTJSTGN6d+Mg13l565iovwK7tDtM0eCo=; b=UeVrVwvmhQ+yWDWwP4VtP1MRW4SCTU1CQscwYMIjZpU2h8tFzFXBLoF5b0k3UOI1Y9 wC8cRPBXMnqTAh3H8eD+YB5oGbs8mpVyxHmpCRo+4EzcP6crPTjap8HVFFbOo5xYiK69 uRF+9tbvzgfXbSt5pI0ea/zic5pLy5yedUrnWFem2rdmZ3dYOAXakjHSFyjjSMcbSzcW SktecTM/MhIRKpvpNVb1XN7wD6WhoiXBVowXvDtAta6fco1SSCf//ljaVPCyq1Aoxevt UWx7amLOenynVdUxJvhCfv72cIKO7a5mLr9RNPCO/kFomWZkm7fynyJ8vGThGEl2D91j gQpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QrxPr+6Z; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si1671338qkm.3.2020.04.10.08.40.09; Fri, 10 Apr 2020 08:40:24 -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=@gmail.com header.s=20161025 header.b=QrxPr+6Z; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbgDJPiE (ORCPT + 99 others); Fri, 10 Apr 2020 11:38:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43961 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbgDJPiE (ORCPT ); Fri, 10 Apr 2020 11:38:04 -0400 Received: by mail-wr1-f68.google.com with SMTP id i10so2652499wrv.10 for ; Fri, 10 Apr 2020 08:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VBKczGYLsv2GTJSTGN6d+Mg13l565iovwK7tDtM0eCo=; b=QrxPr+6Zokq+E+HKmNBf8y79Ddlaewwn8GP1PRaMIzBz9Upg9gtVX0v8e5qSXAgslp HP5QTgLW81HquXtdESlyoaeThSFU0YEmpYBldvPfh0CB6q+oUI+eFyhsAjzCf1qwKLrE QAjRqMDNksMQfm85mfIu4ar0m8IvhAnj0oE1dcX3cfbYoOdk5Se3LK5zjXliq2JUYvA7 HH1A2ziGB860hMbI5hU++6fDjkRXUKkodvIliFCej/nWPuoCIGx4fnzUIv7P0Nk+V9m5 kCVV1vB3eC3JwhadPiqKt0cPjcjWTKZZcD/fTmlac66dSpBoR0rG+0tzsLoX59hPB0IM 3r+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VBKczGYLsv2GTJSTGN6d+Mg13l565iovwK7tDtM0eCo=; b=YcxOYRMYqNZcOGDLubuoj62nqtdIoN1RyBXNJnk+tsSAF9T4GBgh1G+mRQ+eW2/rDf eWXniY30X4YQpM3Dn4Xhet+VN9F7aR84rmxRn/RMjHEFQGv1GXnjNHMCe2jMmC1XobDZ 8BRzbcwVmm7PB1tdUEktCpV1dM2qS1TAK+KSdSuog6XXGehmJOuN0U0pVQ3TDIMlyh0A uFKJQUgSHLcoEAsOAJAbrRpNoOz7u4Me6q4mw89S+ln3mBHovVdngJS1ggNjrbPaHPdU H2syVr9fUQSPh1qMB473JZwhCCDjZnqcNJW1w+cRCoJowavnvnOVgwd36/bdhn7xtOjX enww== X-Gm-Message-State: AGi0PuYsj8I6AYxs1jyvnpWtG0dkDLJQaTCiirkR03MfqgkmLzliOfNQ p8XMX24rAK8i79zPLO6jMyq0pppq X-Received: by 2002:a5d:5230:: with SMTP id i16mr5097555wra.15.1586533081703; Fri, 10 Apr 2020 08:38:01 -0700 (PDT) Received: from [192.168.43.227] (94.197.121.102.threembb.co.uk. [94.197.121.102]) by smtp.gmail.com with ESMTPSA id c17sm3298882wrp.28.2020.04.10.08.38.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Apr 2020 08:38:01 -0700 (PDT) Subject: Re: [PATCH 1/2] staging: vt6656: Refactor the assignment of the phy->signal variable To: Oscar Carter , Forest Bond , Greg Kroah-Hartman Cc: Quentin Deslandes , Amir Mahdi Ghorbanian , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <20200410112834.17490-1-oscar.carter@gmx.com> <20200410112834.17490-2-oscar.carter@gmx.com> From: Malcolm Priestley Message-ID: <986e8e5e-245a-cc70-2c6f-8ac3a4a485c9@gmail.com> Date: Fri, 10 Apr 2020 16:37:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200410112834.17490-2-oscar.carter@gmx.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/vt6656/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] = { > 10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216 > }; Actually you don't need the second values > > +static const u8 vnt_phy_signal[][2] = { > + {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 |= BIT(3) for preamble. > + {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 |= BIT(4) for PK_TYPE_11A Regards Malcolm