Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3230244rwi; Fri, 21 Oct 2022 13:26:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DYTlHADUOTwYcnhhxiy96rSwM1kc9uAaRGekpm12c+93+BzNwj+cC8txEwNyQdFpUDCV3 X-Received: by 2002:a05:6a00:1688:b0:53b:4239:7c5c with SMTP id k8-20020a056a00168800b0053b42397c5cmr21215192pfc.81.1666383998572; Fri, 21 Oct 2022 13:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666383998; cv=none; d=google.com; s=arc-20160816; b=m1AmWnbTYMgDn4Tv+ANMlXoiEt0IxdrgfVZE3oiVmpPQtYHEUC1sZH7m0SIA27IKSY pJwqwulddupfeZqbCJG/XjxWeta7brO+q6K2wRsT4poIXO0Dg3gJlQoovKZKfXPeTDy8 s0D8HMC5wuQ8SU+aQ8t1fiE/cNzsKibGqs3R+rqTCWUutEoglVwPMWbUtY0RjtMaQQqX ANQsfjWggVnYGh7/ETgCKo2p73geOR/d0CW3Hu2p4JU0/PRDL1gW3HjE06HqRWP424g4 IbYVaaU9YRLr/PszPf8r6Bid/Pn9j6kDPBMmP7U5+1LGgc/qyonm2YxAJOAMRuDfcc2g qUiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=JTG4Q7hNZgI2Zu6WLoPHJtGWuNChJ1sTMBguvEFn3iM=; b=ZweTwm5wJQLf5xYfGtsBbHqpN1TJ5ttx4NrT7qysWbF0HkTAKEYFC8kCirzrc0KuO4 zmGjICCxP6V9gGUJdfeDD6RKkko9Q6lZdxkl6Fwd7th4r8jR2lAXLOJcDvF2T0JUZCiL vPhF5hgIqZgzx9ZTWNlr7AYeYvxMnv9QL/WhTY32U3BB88rYQShhiqo2MZsqzomFZemk ApkwLISE/xyvH+byGpUKsIHKUcpqhzDZzaNVweGig1b0MTPk9hd7fhw6doNNlXFlwE6q ofwo6swJ2wou3JsRwSGmPBE7TsLTvBA8WlNVqCOt2VvkH6RyE9TpmS3c87l8lw0QQDx8 jNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=paRn6uMe; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a631003000000b0046ed62f820bsi647221pgl.810.2022.10.21.13.26.20; Fri, 21 Oct 2022 13:26:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@sipsolutions.net header.s=mail header.b=paRn6uMe; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiJUUWU (ORCPT + 65 others); Fri, 21 Oct 2022 16:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiJUUWS (ORCPT ); Fri, 21 Oct 2022 16:22:18 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C86A26FF87 for ; Fri, 21 Oct 2022 13:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=JTG4Q7hNZgI2Zu6WLoPHJtGWuNChJ1sTMBguvEFn3iM=; t=1666383738; x=1667593338; b=paRn6uMepQd4Nv7umNMIJkfXYL1NHy4zhte1EHzf+K7l6BV S6EMixsTAUlSoTqeg/DMbl6TMPKsq9EFXjMBPZEJnRn+xIx3O7BFc7krUmv4O9nw3zJjVIgB/BcqO uNnZ6Srcnr1UkvuAPOBJVow16PUMADJlqoY/RdEVsh9rVS3yGG9cyczNw2Bk/s3YDBA8hVk8UsSEV EedapfTYJE17z4fhQBof+gkgWcP8fwtJJd8t8PSDI+k3dt6+E6eYFEjchiIs5JB5wOGHmW6hmUAcN oOLoZo2vAlcRo+zPgvajon40KsEk3xJSrqFj2KThFpYU2Xss3PKnNJK4+kd014zA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1olyX1-00D0CH-2c; Fri, 21 Oct 2022 22:22:15 +0200 Message-ID: Subject: Re: [PATCH 1/5] wifi: rtl8xxxu: Add central frequency offset tracking From: Johannes Berg To: Bitterblue Smith , Ping-Ke Shih , "linux-wireless@vger.kernel.org" Cc: Jes Sorensen Date: Fri, 21 Oct 2022 22:22:14 +0200 In-Reply-To: References: <2b29b6d9-c17e-76d6-c32f-630f24b407b7@gmail.com> <6a91fd1b8d5e4bf3910366121ed92f3b@realtek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED 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-wireless@vger.kernel.org On Fri, 2022-10-21 at 21:32 +0300, Bitterblue Smith wrote: > >=20 > > #define XTAL1 GENMASK(22, 17) > > #define XTAL0 GENMASK(16, 11) > >=20 > > val32 &=3D ~(XTAL1 | XTAL2) > > val32 |=3D FIELD_PREP(XTAL1, crystal_cap) | > > FIELD_PREP(XTAL0, crystal_cap); > >=20 >=20 > Ah, so that's what FIELD_PREP does. FWIW, personally, I've come to prefer u32_encode_bits() and friends, or, in this case perhaps u32p_replace_bits(&val32, crystal_cap, XTAL0); u32p_replace_bits(&val32, crystal_cap, XTAL1); or maybe writing that as val32 &=3D ~(XTAL0 | XTAL1); val32 |=3D u32_encode_bits(crystal_cap, XTAL0); val32 |=3D u32_encode_bits(crystal_cap, XTAL1); instead. That's partially because there are also le32 variants of it etc. that are simpler to use with endian-fixed firmware interfaces or similar. But YMMV (as might that of the maintainers of this driver) :-) johannes