From: Thomas Petazzoni Date: Wed, 22 Mar 2017 09:03:42 +0100 Subject: [U-Boot] [PATCH v1 15/41] net: mvpp2: introduce PPv2.2 HW descriptors and adapt accessors In-Reply-To: <4cde8882-c622-3292-0328-524cd9ebb782@denx.de> References: <20170321142802.24276-1-sr@denx.de> <20170321142802.24276-16-sr@denx.de> <4cde8882-c622-3292-0328-524cd9ebb782@denx.de> Message-ID: <20170322090342.1a55d603@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, On Wed, 22 Mar 2017 08:11:45 +0100, Stefan Roese wrote: > >> static unsigned long mvpp2_rxdesc_cookie_get(struct mvpp2_port *port, > >> struct mvpp2_rx_desc *rx_desc) > >> { > >> - return rx_desc->pp21.buf_cookie; > >> + if (port->priv->hw_version == MVPP21) { > >> + return rx_desc->pp21.buf_cookie; > >> + } else { > >> + return rx_desc->pp22.buf_cookie_misc & GENMASK_ULL(40, 0); > >> + } > > > > The braces look like something that checkpatch might complain about > > (unnecessary one-line if), but I assume you ran that (using patman, > > right!?). Also inconsistent with the other functions. > > > > If there ends up being a v2, then maybe clean this up, otherwise, whatever. > > I'm aware of this checkpatch "problem", but I prefer to not change > it, to keep the U-Boot version in sync with the Linux version, making > future ports easier. FWIW, precisely due to the checkpatch warning, I removed those braces before submitting the patches to the kernel, so they are not here in the code merged upstream: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/tree/drivers/net/ethernet/marvell/mvpp2.c#n1219 Stefan: I think you used the latest branch I pushed on Github, but I did a few further changes (mainly cosmetic stuff to make checkpatch happy) before submitting patches to mainline. Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com