From: jason@lakedaemon.net (Jason Cooper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/4] net: mvneta: driver for Marvell Armada 370/XP network unit
Date: Fri, 12 Oct 2012 10:31:31 -0400 [thread overview]
Message-ID: <20121012143131.GP12330@titan.lakedaemon.net> (raw)
In-Reply-To: <20121011212629.GA14171@electric-eye.fr.zoreil.com>
On Thu, Oct 11, 2012 at 11:26:29PM +0200, Francois Romieu wrote:
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> :
> [...]
> > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> > new file mode 100644
> > index 0000000..4f7fe08
> > --- /dev/null
> > +++ b/drivers/net/ethernet/marvell/mvneta.c
> [...]
> > +static void mvneta_rxq_desc_num_update(struct mvneta_port *pp,
> > + struct mvneta_rx_queue *rxq,
> > + int rx_done, int rx_filled)
> > +{
> > + u32 val;
> > +
> > + if ((rx_done <= 0xff) && (rx_filled <= 0xff)) {
> > + val = rx_done |
> > + (rx_filled << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT);
> > + mvreg_write(pp, MVNETA_RXQ_STATUS_UPDATE_REG(rxq->id), val);
> > + return;
> > + }
> > +
> > + /* Only 255 descriptors can be added at once */
> > + while ((rx_done > 0) || (rx_filled > 0)) {
> > + if (rx_done <= 0xff) {
> > + val = rx_done;
> > + rx_done = 0;
> > + } else {
> > + val = 0xff;
> > + rx_done -= 0xff;
> > + }
> > + if (rx_filled <= 0xff) {
> > + val |= rx_filled
> > + << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT;
>
> val |= rx_filled << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT;
I agree with Francois on most of these. I prefer readability over hard
80 column limits. Although, 80 columns is still sound guidance. For
example, a majority of the broken lines are due to long macro and
constant names. I did a 'git grep NETA' and didn't see anything
alarming. So, above could become
val |= rx_filled << NETA_RXQ_ADD_NONOCC_SHIFT;
thx,
Jason.
WARNING: multiple messages have this Message-ID (diff)
From: Jason Cooper <jason@lakedaemon.net>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
"David S. Miller" <davem@davemloft.net>,
Lennert Buytenhek <kernel@wantstofly.org>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Andrew Lunn <andrew@lunn.ch>,
Gregory Clement <gregory.clement@free-electrons.com>,
Lior Amsalem <alior@marvell.com>,
Maen Suleiman <maen@marvell.com>, Rami Rosen <rosenr@marvell.com>
Subject: Re: [PATCH v2 1/4] net: mvneta: driver for Marvell Armada 370/XP network unit
Date: Fri, 12 Oct 2012 10:31:31 -0400 [thread overview]
Message-ID: <20121012143131.GP12330@titan.lakedaemon.net> (raw)
In-Reply-To: <20121011212629.GA14171@electric-eye.fr.zoreil.com>
On Thu, Oct 11, 2012 at 11:26:29PM +0200, Francois Romieu wrote:
> Thomas Petazzoni <thomas.petazzoni@free-electrons.com> :
> [...]
> > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> > new file mode 100644
> > index 0000000..4f7fe08
> > --- /dev/null
> > +++ b/drivers/net/ethernet/marvell/mvneta.c
> [...]
> > +static void mvneta_rxq_desc_num_update(struct mvneta_port *pp,
> > + struct mvneta_rx_queue *rxq,
> > + int rx_done, int rx_filled)
> > +{
> > + u32 val;
> > +
> > + if ((rx_done <= 0xff) && (rx_filled <= 0xff)) {
> > + val = rx_done |
> > + (rx_filled << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT);
> > + mvreg_write(pp, MVNETA_RXQ_STATUS_UPDATE_REG(rxq->id), val);
> > + return;
> > + }
> > +
> > + /* Only 255 descriptors can be added at once */
> > + while ((rx_done > 0) || (rx_filled > 0)) {
> > + if (rx_done <= 0xff) {
> > + val = rx_done;
> > + rx_done = 0;
> > + } else {
> > + val = 0xff;
> > + rx_done -= 0xff;
> > + }
> > + if (rx_filled <= 0xff) {
> > + val |= rx_filled
> > + << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT;
>
> val |= rx_filled << MVNETA_RXQ_ADD_NON_OCCUPIED_SHIFT;
I agree with Francois on most of these. I prefer readability over hard
80 column limits. Although, 80 columns is still sound guidance. For
example, a majority of the broken lines are due to long macro and
constant names. I did a 'git grep NETA' and didn't see anything
alarming. So, above could become
val |= rx_filled << NETA_RXQ_ADD_NONOCC_SHIFT;
thx,
Jason.
next prev parent reply other threads:[~2012-10-12 14:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 15:27 [PATCH v2] Network driver for the Armada 370 and Armada XP ARM Marvell SoCs Thomas Petazzoni
2012-10-11 15:27 ` Thomas Petazzoni
2012-10-11 15:27 ` [PATCH v2 1/4] net: mvneta: driver for Marvell Armada 370/XP network unit Thomas Petazzoni
2012-10-11 15:27 ` Thomas Petazzoni
2012-10-11 15:46 ` Rob Herring
2012-10-11 15:46 ` Rob Herring
2012-10-11 16:38 ` Thomas Petazzoni
2012-10-11 16:38 ` Thomas Petazzoni
2012-10-12 14:16 ` Thomas Petazzoni
2012-10-12 14:16 ` Thomas Petazzoni
2012-10-11 18:13 ` Baruch Siach
2012-10-11 18:13 ` Baruch Siach
2012-10-11 21:26 ` Francois Romieu
2012-10-11 21:26 ` Francois Romieu
2012-10-12 14:31 ` Jason Cooper [this message]
2012-10-12 14:31 ` Jason Cooper
2012-10-12 14:59 ` Thomas Petazzoni
2012-10-12 14:59 ` Thomas Petazzoni
2012-10-12 16:03 ` Jason Cooper
2012-10-12 16:03 ` Jason Cooper
2012-10-11 15:28 ` [PATCH v2 2/4] net: mvneta: update MAINTAINERS file for the mvneta maintainers Thomas Petazzoni
2012-10-11 15:28 ` Thomas Petazzoni
2012-10-11 15:28 ` [PATCH v2 3/4] arm: mvebu: add Ethernet controllers using mvneta driver for Armada 370/XP Thomas Petazzoni
2012-10-11 15:28 ` Thomas Petazzoni
2012-10-11 15:28 ` [PATCH v2 4/4] arm: mvebu: enable Ethernet controllers on Armada 370/XP eval boards Thomas Petazzoni
2012-10-11 15:28 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121012143131.GP12330@titan.lakedaemon.net \
--to=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.