All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Einon <mark.einon@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat registers to zero
Date: Thu, 21 Aug 2014 11:05:14 +0100	[thread overview]
Message-ID: <20140821100514.GD2230@msilap.einon.net> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1747D483@AcuExch.aculab.com>

On Thu, Aug 21, 2014 at 08:40:20AM +0000, David Laight wrote:
> From: Mark Einon
> > Replace a long list of contiguous writel() calls with a for loop iterating
> > over the same address values.
> > 
> > Also remove redundant comments on the macstat registers, the variable names
> > are good enough.
> ...
> > -	writel(0, &macstat->txrx_0_64_byte_frames);
> ...
> > -	writel(0, &macstat->carry_reg2);
> > +	/* initialize all the macstat registers to zero on the device  */
> > +	for (reg = &macstat->txrx_0_64_byte_frames;
> > +	     reg <= &macstat->carry_reg2; reg++)
> > +		writel(0, reg);
> ...
> >  struct macstat_regs {			/* Location: */
> >  	u32 pad[32];			/*  0x6000 - 607C */
> > 
> > -	/* Tx/Rx 0-64 Byte Frame Counter */
> > +	/* counters */
> >  	u32 txrx_0_64_byte_frames;	/*  0x6080 */
> > -
> > -	/* Tx/Rx 65-127 Byte Frame Counter */
> >  	u32 txrx_65_127_byte_frames;	/*  0x6084 */
> 
> I think it would be best to also convert the stats counters to an array.

Hi David, thanks for the review.

There's other code that accesses these registers individually, taking into
account carries - so I don't think using an array would change much, as
we'd still need a way of identifying individual indices.

Cheers,

Mark

WARNING: multiple messages have this Message-ID (diff)
From: Mark Einon <mark.einon@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat registers to zero
Date: Thu, 21 Aug 2014 11:05:14 +0100	[thread overview]
Message-ID: <20140821100514.GD2230@msilap.einon.net> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1747D483@AcuExch.aculab.com>

On Thu, Aug 21, 2014 at 08:40:20AM +0000, David Laight wrote:
> From: Mark Einon
> > Replace a long list of contiguous writel() calls with a for loop iterating
> > over the same address values.
> > 
> > Also remove redundant comments on the macstat registers, the variable names
> > are good enough.
> ...
> > -	writel(0, &macstat->txrx_0_64_byte_frames);
> ...
> > -	writel(0, &macstat->carry_reg2);
> > +	/* initialize all the macstat registers to zero on the device  */
> > +	for (reg = &macstat->txrx_0_64_byte_frames;
> > +	     reg <= &macstat->carry_reg2; reg++)
> > +		writel(0, reg);
> ...
> >  struct macstat_regs {			/* Location: */
> >  	u32 pad[32];			/*  0x6000 - 607C */
> > 
> > -	/* Tx/Rx 0-64 Byte Frame Counter */
> > +	/* counters */
> >  	u32 txrx_0_64_byte_frames;	/*  0x6080 */
> > -
> > -	/* Tx/Rx 65-127 Byte Frame Counter */
> >  	u32 txrx_65_127_byte_frames;	/*  0x6084 */
> 
> I think it would be best to also convert the stats counters to an array.

Hi David, thanks for the review.

There's other code that accesses these registers individually, taking into
account carries - so I don't think using an array would change much, as
we'd still need a way of identifying individual indices.

Cheers,

Mark

  reply	other threads:[~2014-08-21 10:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 22:17 [PATCH 0/8] Implement NAPI in et131x Mark Einon
2014-08-20 22:17 ` Mark Einon
2014-08-20 22:17 ` [PATCH 1/8] staging: et131x: Use eth_mac_addr() instead of duplicating the functionality Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-20 22:17 ` [PATCH 2/8] staging: et131x: Don't handle rx/tx packets when changing mtu Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-20 22:17 ` [PATCH 3/8] staging: et131x: Use for loop to initialise contiguous registers to zero Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-30 20:32   ` Greg KH
2014-08-31 14:25     ` Mark Einon
2014-08-31 16:11       ` Greg KH
2014-08-20 22:17 ` [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat " Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-21  8:40   ` David Laight
2014-08-21 10:05     ` Mark Einon [this message]
2014-08-21 10:05       ` Mark Einon
2014-08-20 22:17 ` [PATCH 5/8] staging: et131x: Remove unnecessary i2c_wack variable Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-20 22:22   ` Fabio Estevam
2014-08-20 22:22     ` Fabio Estevam
2014-08-21  9:18     ` Mark Einon
2014-08-21  9:18       ` Mark Einon
2014-08-21 12:06       ` Fabio Estevam
2014-08-21 12:06         ` Fabio Estevam
2014-08-21 14:59         ` Mark Einon
2014-08-21 14:59           ` Mark Einon
2014-08-20 22:17 ` [PATCH 6/8] staging: et131x: Rename NUM_PACKETS_HANDLED to MAX_PACKETS_HANDLED Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-20 22:17 ` [PATCH 7/8] staging: et131x: Fix ET_INTR_TXDMA_ISR register name typo Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-20 22:17 ` [PATCH 8/8] staging: et131x: Implement NAPI support Mark Einon
2014-08-20 22:17   ` Mark Einon
2014-08-21  3:25   ` Stephen Hemminger
2014-08-21  9:23     ` Mark Einon
2014-08-21  9:23       ` Mark Einon
2014-08-21  3:25   ` Stephen Hemminger
2014-08-21  9:25     ` Mark Einon
2014-08-21  9:25       ` Mark Einon

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=20140821100514.GD2230@msilap.einon.net \
    --to=mark.einon@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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.