From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8301AC7EE23 for ; Fri, 26 May 2023 15:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237508AbjEZPvS (ORCPT ); Fri, 26 May 2023 11:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231470AbjEZPvP (ORCPT ); Fri, 26 May 2023 11:51:15 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B6E114; Fri, 26 May 2023 08:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=luSvtwFvYuWEDfQ0oWnh9KpQF4jauEGj7bA+0Z7dn4Y=; b=OA7OqI7gnvQqMRhLYwoLU6eBos sXAQseXvyzb55q9L8L94gtuYNT8Q3H7U9yXwejTnWnRnekY8CFcbpe20VuZio0bz9+xZ8CAXCQOG+ gfZs40AURVleyDRDNerPyG6/TQ4FKgck+/Q0LsXFaV1mGaIqPnKtwmrFQ+CvRKlRt9Y5b9v3bNQOk Tqs+BeduE/jGpym96MQOJNdqQBjOSuWzQN9w8Tn3VHf5N4wGR3Eh8Nn7oJc6R8qL2apVFgmDiiknu NPG47lMmnGT3ZPzyN7T5KBeCDgkHW6QCAu1TLsjix32DIdLnt5IDBo910YXcYoMXyEUXkShsISgfh WOtBoWtw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:44614) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2ZiN-0005qz-1e; Fri, 26 May 2023 16:50:51 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q2ZiC-0003rr-Ob; Fri, 26 May 2023 16:50:40 +0100 Date: Fri, 26 May 2023 16:50:40 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: arinc9.unal@gmail.com, 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 , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , 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 Subject: Re: [PATCH net-next 24/30] net: dsa: mt7530: rename MT7530_MFC to MT753X_MFC Message-ID: References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-25-arinc.unal@arinc9.com> <20230526154258.skbkk4p34ro5uivr@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230526154258.skbkk4p34ro5uivr@skbuf> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!