Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756692AbcJGPC7 (ORCPT ); Fri, 7 Oct 2016 11:02:59 -0400 Received: from smtprelay0089.hostedemail.com ([216.40.44.89]:46658 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752298AbcJGPCv (ORCPT ); Fri, 7 Oct 2016 11:02:51 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3870:3871:3872:3874:4250:4321:5007:8957:10004:10400:10466:10848:11026:11232:11473:11657:11658:11914:12043:12048:12296:12438:12740:12760:13069:13311:13357:13439:14659:14721:14819:21080:21451:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: year89_5189ee7b5d911 X-Filterd-Recvd-Size: 2407 Message-ID: <1475852559.1945.2.camel@perches.com> Subject: Re: [PATCH v4 01/10] ethernet: add sun8i-emac driver From: Joe Perches To: Corentin Labbe , robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, davem@davemloft.net, f.fainelli@gmail.com, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 07 Oct 2016 08:02:39 -0700 In-Reply-To: <1475828757-926-2-git-send-email-clabbe.montjoie@gmail.com> References: <1475828757-926-1-git-send-email-clabbe.montjoie@gmail.com> <1475828757-926-2-git-send-email-clabbe.montjoie@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.0-2ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1280 Lines: 48 On Fri, 2016-10-07 at 10:25 +0200, Corentin Labbe wrote: > This patch add support for sun8i-emac ethernet MAC hardware. > It could be found in Allwinner H3/A83T/A64 SoCs. trivial notes: > diff --git a/drivers/net/ethernet/allwinner/sun8i-emac.c b/drivers/net/ethernet/allwinner/sun8i-emac.c [] > +static const char const estats_str[][ETH_GSTRING_LEN] = { one too many const > +/* MAGIC value for knowing if a descriptor is available or not */ > +#define DCLEAN cpu_to_le32(BIT(16) | BIT(14) | BIT(12) | BIT(10) | BIT(9)) Aren't there #defines for these bits? > +static void sun8i_emac_flow_ctrl(struct sun8i_emac_priv *priv, int duplex, > + int fc) > +{ > + u32 flow = 0; > + > + flow = readl(priv->base + EMAC_RX_CTL0); > + if (fc & EMAC_FLOW_RX) > + flow |= BIT(16); > + else > + flow &= ~BIT(16); > + writel(flow, priv->base + EMAC_RX_CTL0); > + > + flow = readl(priv->base + EMAC_TX_FLOW_CTL); > + if (fc & EMAC_FLOW_TX) > + flow |= BIT(0); > + else > + flow &= ~BIT(0); more magic bits that could be #defines > +static int sun8i_emac_rx_from_ddesc(struct net_device *ndev, int i) > +{ > [] > + /* the checksum or length of received frame's payload is wrong*/ > + if (dstatus & BIT(0)) { [] > + if (dstatus & BIT(1)) { [] > + if ((dstatus & BIT(3))) { etc...