summaryrefslogtreecommitdiff
path: root/drivers/net/stmmac/norm_desc.c
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2010-09-17 03:23:42 +0000
committerDavid S. Miller <davem@davemloft.net>2010-09-17 16:12:58 -0700
commitb71c7aaa1e2a9858f0c469026098fbd6e046d7bb (patch)
tree39c7454d1e2230f9176e1a3c47b92e3f76a9f256 /drivers/net/stmmac/norm_desc.c
parentc629882ac73cab2cd41d9948caeed633fc570fc0 (diff)
stmmac: use one memset() to reset TDES01
Use one memset() to reset all TDES01 fields instead of one by one to reduce number of instructions. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/stmmac/norm_desc.c')
-rw-r--r--drivers/net/stmmac/norm_desc.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/net/stmmac/norm_desc.c b/drivers/net/stmmac/norm_desc.c
index 51f4440ab98b..0dce90cb8124 100644
--- a/drivers/net/stmmac/norm_desc.c
+++ b/drivers/net/stmmac/norm_desc.c
@@ -174,22 +174,7 @@ static void ndesc_release_tx_desc(struct dma_desc *p)
{
int ter = p->des01.tx.end_ring;
- /* clean field used within the xmit */
- p->des01.tx.first_segment = 0;
- p->des01.tx.last_segment = 0;
- p->des01.tx.buffer1_size = 0;
-
- /* clean status reported */
- p->des01.tx.error_summary = 0;
- p->des01.tx.underflow_error = 0;
- p->des01.tx.no_carrier = 0;
- p->des01.tx.loss_carrier = 0;
- p->des01.tx.excessive_deferral = 0;
- p->des01.tx.excessive_collisions = 0;
- p->des01.tx.late_collision = 0;
- p->des01.tx.heartbeat_fail = 0;
- p->des01.tx.deferred = 0;
-
+ memset(p, 0, offsetof(struct dma_desc, des2));
/* set termination field */
p->des01.tx.end_ring = ter;
}