diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-19 15:52:29 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-13 11:02:15 +0200 |
commit | 6289b5a51d58adfe2f8791cd4c6deb0e6f01267a (patch) | |
tree | 96a185b5fd03ba4c1f54aa2a3e8b4fc5c8b5801b /net | |
parent | faa61661cf6373dd606a34af9c082c0bb521126a (diff) | |
download | barebox-6289b5a51d58adfe2f8791cd4c6deb0e6f01267a.tar.gz barebox-6289b5a51d58adfe2f8791cd4c6deb0e6f01267a.tar.xz |
net: remove unnecessary if
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 28 |
1 files changed, 11 insertions, 17 deletions
@@ -227,6 +227,7 @@ int NetLoopInit(proto_t protocol) struct eth_device *eth_current = eth_get_current(); IPaddr_t ip; int ret; + int i; if (!eth_current) { printf("Current ethernet device not set!\n"); @@ -241,26 +242,19 @@ int NetLoopInit(proto_t protocol) NetArpWaitTxPacket = NULL; NetArpWaitPacketIP = 0; NetArpWaitReplyIP = 0; - NetArpWaitTxPacket = NULL; - NetTxPacket = NULL; - if (!NetTxPacket) { - int i; - /* - * Setup packet buffers, aligned correctly. - */ - NetTxPacket = &PktBuf[0] + (PKTALIGN - 1); - NetTxPacket -= (ulong)NetTxPacket % PKTALIGN; - for (i = 0; i < PKTBUFSRX; i++) { - NetRxPackets[i] = NetTxPacket + (i+1)*PKTSIZE_ALIGN; - } + /* + * Setup packet buffers, aligned correctly. + */ + NetTxPacket = &PktBuf[0] + (PKTALIGN - 1); + NetTxPacket -= (ulong)NetTxPacket % PKTALIGN; + for (i = 0; i < PKTBUFSRX; i++) { + NetRxPackets[i] = NetTxPacket + (i+1)*PKTSIZE_ALIGN; } - if (!NetArpWaitTxPacket) { - NetArpWaitTxPacket = &NetArpWaitPacketBuf[0] + (PKTALIGN - 1); - NetArpWaitTxPacket -= (ulong)NetArpWaitTxPacket % PKTALIGN; - NetArpWaitTxPacketSize = 0; - } + NetArpWaitTxPacket = &NetArpWaitPacketBuf[0] + (PKTALIGN - 1); + NetArpWaitTxPacket -= (ulong)NetArpWaitTxPacket % PKTALIGN; + NetArpWaitTxPacketSize = 0; if (eth_open() < 0) return -1; |