RE: [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat registers to zero
From: David Laight <hidden>
Date: 2014-08-21 08:41:44
Also in:
lkml
From: David Laight <hidden>
Date: 2014-08-21 08:41:44
Also in:
lkml
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. David