From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 4/7] net: fec_imx: Drop struct fec_frame
Date: Mon, 17 Sep 2018 22:21:19 -0700 [thread overview]
Message-ID: <20180918052122.12248-5-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180918052122.12248-1-andrew.smirnov@gmail.com>
Drop struct fec_frame since it doesn't have any real users in the
code. It is only referenced in fec_recv() and is used by that function
as a generic pointer.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
drivers/net/fec_imx.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 36218f3c9..ff5a64174 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -33,12 +33,6 @@
#include "fec_imx.h"
-struct fec_frame {
- uint8_t data[1500]; /* actual data */
- int length; /* actual length */
- int used; /* buffer in use or not */
- uint8_t head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */
-};
/*
* MII-interface related functions
@@ -530,7 +524,6 @@ static int fec_recv(struct eth_device *dev)
struct buffer_descriptor __iomem *rbd = &fec->rbd_base[fec->rbd_index];
uint32_t ievent;
int frame_length, len = 0;
- struct fec_frame *frame;
uint16_t bd_status;
/*
@@ -578,17 +571,16 @@ static int fec_recv(struct eth_device *dev)
const uint16_t data_length = readw(&rbd->data_length);
if (data_length - 4 > 14) {
+ void *frame = phys_to_virt(readl(&rbd->data_pointer));
if (fec_is_imx28(fec))
- imx28_fix_endianess_rd(
- phys_to_virt(readl(&rbd->data_pointer)),
- (data_length + 3) >> 2);
+ imx28_fix_endianess_rd(frame,
+ (data_length + 3) >> 2);
/*
* Get buffer address and size
*/
- frame = phys_to_virt(readl(&rbd->data_pointer));
frame_length = data_length - 4;
- net_receive(dev, frame->data, frame_length);
+ net_receive(dev, frame, frame_length);
len = frame_length;
}
}
--
2.17.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-09-18 5:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 5:21 [PATCH 0/7] non-coherent Rx buffers in FEC and some small fixes Andrey Smirnov
2018-09-18 5:21 ` [PATCH 1/7] net: fec_imx: Drop extra indentation level by exiting early Andrey Smirnov
2018-09-18 5:21 ` [PATCH 2/7] net: fec_imx: Don't check bd_status & FEC_RBD_ERR twice Andrey Smirnov
2018-09-18 5:21 ` [PATCH 3/7] net: fec_imx: Read data_length only once Andrey Smirnov
2018-09-18 5:21 ` Andrey Smirnov [this message]
2018-09-18 5:21 ` [PATCH 5/7] net: fec_imx: Drop frame_length Andrey Smirnov
2018-09-18 5:21 ` [PATCH 6/7] net: fec_imx: Make use of readx_poll_timeout() macros Andrey Smirnov
2018-09-18 5:21 ` [PATCH 7/7] net: fec_imx: Do not use DMA coherent memory for Rx buffers Andrey Smirnov
2019-01-14 12:21 ` Uwe Kleine-König
2019-01-14 14:17 ` Uwe Kleine-König
2018-09-19 7:41 ` [PATCH 0/7] non-coherent Rx buffers in FEC and some small fixes Sascha Hauer
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=20180918052122.12248-5-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox