summaryrefslogtreecommitdiffstats
path: root/net/tftp.c
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2009-07-23 03:01:03 -0400
committerBen Warren <biggerbadderben@gmail.com>2009-08-07 17:32:16 -0700
commit0ebf04c607b54a352629dcf7e76b76f1785dae54 (patch)
tree0beff99c94a3db8d1e9cc5f3b786ae7474085f4c /net/tftp.c
parent187af954cf7958c24efcf0fd62289bbdb4f1f24e (diff)
downloadblackbird-obmc-uboot-0ebf04c607b54a352629dcf7e76b76f1785dae54.tar.gz
blackbird-obmc-uboot-0ebf04c607b54a352629dcf7e76b76f1785dae54.zip
minor debug cleanups in ./net
Minor ./net cleanups - no functional changes - change #ifdef DEBUG printf(); #endif to just debug() - changed __FUNCTION__ to __func__ - got rid of extra whitespace between function and opening brace - removed unnecessary braces on if statements gcc dead code elimination should make this functionally/size equivalent when DEBUG is not defined. (confirmed on Blackfin, with gcc 4.3.3). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'net/tftp.c')
-rw-r--r--net/tftp.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/net/tftp.c b/net/tftp.c
index b0f1cca0b6..74d9e4215d 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -10,8 +10,6 @@
#include "tftp.h"
#include "bootp.h"
-#undef ET_DEBUG
-
#if defined(CONFIG_CMD_NET)
#define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
@@ -196,9 +194,7 @@ TftpSend (void)
strcpy ((char *)pkt, "timeout");
pkt += 7 /*strlen("timeout")*/ + 1;
sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
-#ifdef ET_DEBUG
- printf("send option \"timeout %s\"\n", (char *)pkt);
-#endif
+ debug("send option \"timeout %s\"\n", (char *)pkt);
pkt += strlen((char *)pkt) + 1;
/* try for more effic. blk size */
pkt += sprintf((char *)pkt,"blksize%c%d%c",
@@ -295,9 +291,7 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
break;
case TFTP_OACK:
-#ifdef ET_DEBUG
- printf("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
-#endif
+ debug("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
TftpState = STATE_OACK;
TftpServerPort = src;
/*
@@ -309,10 +303,8 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
if (strcmp ((char*)pkt+i,"blksize") == 0) {
TftpBlkSize = (unsigned short)
simple_strtoul((char*)pkt+i+8,NULL,10);
-#ifdef ET_DEBUG
- printf ("Blocksize ack: %s, %d\n",
+ debug("Blocksize ack: %s, %d\n",
(char*)pkt+i+8,TftpBlkSize);
-#endif
break;
}
}
@@ -348,11 +340,8 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
}
}
-#ifdef ET_DEBUG
- if (TftpState == STATE_RRQ) {
- puts ("Server did not acknowledge timeout option!\n");
- }
-#endif
+ if (TftpState == STATE_RRQ)
+ debug("Server did not acknowledge timeout option!\n");
if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
/* first block received */
OpenPOWER on IntegriCloud