Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933890AbbKSEBF (ORCPT ); Wed, 18 Nov 2015 23:01:05 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:34380 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933261AbbKSEBD (ORCPT ); Wed, 18 Nov 2015 23:01:03 -0500 Date: Wed, 18 Nov 2015 23:01:01 -0500 (EST) Message-Id: <20151118.230101.2199889775612098415.davem@davemloft.net> To: mans@mansr.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v7] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller From: David Miller In-Reply-To: <1447867764-23075-1-git-send-email-mans@mansr.com> References: <1447867764-23075-1-git-send-email-mans@mansr.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 18 Nov 2015 20:01:02 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 841 Lines: 26 From: Mans Rullgard Date: Wed, 18 Nov 2015 17:29:24 +0000 > +static int nb8800_poll(struct napi_struct *napi, int budget) > +{ > + struct net_device *dev = napi->dev; > + struct nb8800_priv *priv = netdev_priv(dev); > + struct nb8800_rx_desc *rxd; > + int work = 0; > + int last = priv->rx_eoc; > + int next; ... > + next = (last + 1) % RX_DESC_COUNT; You should look at what the assembler looks like for these modulo operations. They will be much simpler (ie. one instruction) if you use unsigned variables to hold the queue indices. Please fix this in the entire driver. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/