Commit b71c7aaa authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller

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: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c629882a
...@@ -284,7 +284,7 @@ static void enh_desc_release_tx_desc(struct dma_desc *p) ...@@ -284,7 +284,7 @@ static void enh_desc_release_tx_desc(struct dma_desc *p)
{ {
int ter = p->des01.etx.end_ring; int ter = p->des01.etx.end_ring;
memset(p, 0, sizeof(struct dma_desc)); memset(p, 0, offsetof(struct dma_desc, des2));
p->des01.etx.end_ring = ter; p->des01.etx.end_ring = ter;
} }
......
...@@ -174,22 +174,7 @@ static void ndesc_release_tx_desc(struct dma_desc *p) ...@@ -174,22 +174,7 @@ static void ndesc_release_tx_desc(struct dma_desc *p)
{ {
int ter = p->des01.tx.end_ring; int ter = p->des01.tx.end_ring;
/* clean field used within the xmit */ memset(p, 0, offsetof(struct dma_desc, des2));
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;
/* set termination field */ /* set termination field */
p->des01.tx.end_ring = ter; p->des01.tx.end_ring = ter;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment