Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4302901rwd; Sun, 4 Jun 2023 02:13:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Gvgx1ehCI+zVb/uBG5KcwLEoa26eAlefBGbJEoF0rr7jcVh3JHN73m7yEp34VKfv7RTMT X-Received: by 2002:a92:d405:0:b0:338:98a9:3898 with SMTP id q5-20020a92d405000000b0033898a93898mr13826207ilm.21.1685869984327; Sun, 04 Jun 2023 02:13:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685869984; cv=pass; d=google.com; s=arc-20160816; b=TCaZ35jAaBeWZ0vI50fqAjtC6RcE6lwI2DA43Wnj86k4Du/II6zpqaLeGDqj3Gxqta afJt3K8M5ycGaKu5SzRp2repovbX1TxDY05hWQreWmXLVy1P4ochtUYaVboeBg4nDWN9 UUsTdUqHv/kr8EiSCPujyxsC9KewtNbiRTEpxjQrYut5RynhWFA+cMxgfVNI2mwKl0Ol RkGvDI5JIG+ihjkK53pvwxVWjxWOLeEXbO+p0i47Sq+xNFRo3Y3a11Usm8Y7OG5Fgx8i fBJl9l5neRz2KbOfTRQnnOcySOjdu+Bv9cLv/dli1byQZR+5pdVD1O0MAcwgKGVNtUmm GZhQ== ARC-Message-Signature: i=2; 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=sfXhf5HJgDnX1ZAfbfzJSTS4W+MU2gPcWf2z5/WiU2I=; b=tCts2Z4C68IX1j/H42BksQJGMAvwpmTgLdnG1OCd3C4oRbcjKD+zX/FK11usK+oiEu k4JJiBG0aTQ+oAVBUVFguaUtJ5yzvh6YajbWYxBhxhWvYv8vAdGgn6D/kIdR4742G4UE JeHSMErArVUsg1hS9vNSpQKIdmJC2qVybikf5RM47BDJPQGAu5lxed/NM5PcXaCNFYw0 Wq5jDl2n/7KynDXytwNpzDg1qUcuxTiamKqCKNfUXBVBxI9pCrqMmS1WkSnbLSxrieBu GTcLOhjcqlbDa4PXAV33dPbi2l8G0Q5F9hS01Hhf2uSLdUKFQhI/9UW1rRZzrLbVSxaQ cGiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b=faOgHM7y; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az9-20020a056a02004900b0053f479ef142si3927322pgb.124.2023.06.04.02.12.52; Sun, 04 Jun 2023 02:13:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@arinc9.com header.s=zmail header.b=faOgHM7y; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjFDIHf (ORCPT + 99 others); Sun, 4 Jun 2023 04:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjFDIHe (ORCPT ); Sun, 4 Jun 2023 04:07:34 -0400 Received: from sender3-op-o19.zoho.com (sender3-op-o19.zoho.com [136.143.184.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 028AFED; Sun, 4 Jun 2023 01:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685866005; cv=none; d=zohomail.com; s=zohoarc; b=PBkjITfkcgLIrj2ukmOM0fJ4ihuOMqEtafmR6mLgSGjFYsPWhsa/gIVDeFBxRvEV00S3RKY0KxRNzRIriDKzhx/meoRB2k62oCGQGX8q5t16jdELu89k2cjkr4V2zGtnBeYfbeEIgxXJvmI7RltKCCWhCdYiVL2BUjy8a0gFz1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685866005; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=sfXhf5HJgDnX1ZAfbfzJSTS4W+MU2gPcWf2z5/WiU2I=; b=XO/GcWvk1dGtQphlY+JLIITYbd+c2jcZlNAdFTE3XvKRE6nbNvnwN8kVWpCw6DwvXHgPd0792ZuwZn8SE77mQS7qDuw7nqkV7NE6yE+kL31MKHULFA1KaQeYmNSVDk7nRF/7pOraSQKbIddZQV3Pm/40Zdg+RG5/qkZM7gJSHrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685866005; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=sfXhf5HJgDnX1ZAfbfzJSTS4W+MU2gPcWf2z5/WiU2I=; b=faOgHM7yJfCX/G92IExil29L7G5rtErAxx0mk8VSkP3ZmS8nxcLRVlhYuCYshZL+ KMeA9mHW0+XhK//TTuG01mIzt9Vyt8ct+X8qezLytZdYPzBK6+yhUwCP+fkdTcWEg+E ucMh091BVH2PsUjQ8b5C0OxIBiKTZjcVNWddMxVg= Received: from [192.168.66.198] (178-147-169-233.haap.dm.cosmote.net [178.147.169.233]) by mx.zohomail.com with SMTPS id 16858660033101021.621262772672; Sun, 4 Jun 2023 01:06:43 -0700 (PDT) Message-ID: Date: Sun, 4 Jun 2023 11:06:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net-next 24/30] net: dsa: mt7530: rename MT7530_MFC to MT753X_MFC Content-Language: en-US To: "Russell King (Oracle)" , Vladimir Oltean Cc: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-25-arinc.unal@arinc9.com> <20230526154258.skbkk4p34ro5uivr@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On 26.05.2023 18:50, Russell King (Oracle) wrote: > On Fri, May 26, 2023 at 06:42:58PM +0300, Vladimir Oltean wrote: >> On Mon, May 22, 2023 at 03:15:26PM +0300, arinc9.unal@gmail.com wrote: >>> /* Disable flooding on all ports */ >>> - mt7530_clear(priv, MT7530_MFC, BC_FFP_MASK | UNM_FFP_MASK | >>> - UNU_FFP_MASK); >>> + mt7530_clear(priv, MT753X_MFC, MT753X_BC_FFP_MASK | MT753X_UNM_FFP_MASK >>> + | MT753X_UNU_FFP_MASK); >> >> The preferred coding style is not to start new lines with operators. >> >>> +/* Register for CPU forward control */ >>> #define MT7531_CFC 0x4 >>> #define MT7531_MIRROR_EN BIT(19) >>> -#define MT7531_MIRROR_MASK (MIRROR_MASK << 16) >>> -#define MT7531_MIRROR_PORT_GET(x) (((x) >> 16) & MIRROR_MASK) >>> -#define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16) >>> +#define MT7531_MIRROR_MASK (0x7 << 16) >> >> minor nitpick: if you express this as GENMASK(18, 16), it will be a bit >> easier to cross-check with the datasheet, since both 18 and 16 are more >> representative than 0x7. >> >>> +#define MT7531_MIRROR_PORT_GET(x) (((x) >> 16) & 0x7) >> >> also here: (((x) & GENMASK(18, 16)) >> 16) > > Even better are: > #define MT7531_MIRROR_PORT_GET(x) FIELD_GET(MT7531_MIRROR_MASK, x) > >> >>> +#define MT7531_MIRROR_PORT_SET(x) (((x) & 0x7) << 16) >> >> and here: (((x) << 16) & GENMASK(18, 16)) > > #define MT7531_MIRROR_PORT_SET(x) FIELD_PREP(MT7531_MIRROR_MASK, x) > > No need to add parens around "x" in either of these uses as we're not > doing anything with x other than passing it into another macro. Thanks. I suppose the GENMASK, FIELD_PREP, and FIELD_GET macros can be widely used on mt7530.h? Like GENMASK(2, 0) on MT7530_MIRROR_MASK and FIELD_PREP(MT7530_MIRROR_MASK, x) on MT7530_MIRROR_PORT(x)? Arınç