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>
diff --git a/net/nfs.c b/net/nfs.c
index 0101629..27395fb 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -29,8 +29,6 @@
#include "nfs.h"
#include "bootp.h"
-/*#define NFS_DEBUG*/
-
#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_NFS)
#define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
@@ -357,9 +355,7 @@
static void
NfsSend (void)
{
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
switch (NfsState) {
case STATE_PRCLOOKUP_PROG_MOUNT_REQ:
@@ -397,9 +393,7 @@
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
return -1;
@@ -427,9 +421,7 @@
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@ -454,9 +446,7 @@
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@ -480,9 +470,7 @@
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@ -507,9 +495,7 @@
struct rpc_t rpc_pkt;
int rlen;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@ -544,9 +530,7 @@
struct rpc_t rpc_pkt;
int rlen;
-#ifdef NFS_DEBUG_nop
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((uchar *)&rpc_pkt, pkt, sizeof(rpc_pkt.u.reply));
@@ -601,9 +585,7 @@
{
int rlen;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
if (dest != NfsOurPort) return;
@@ -661,9 +643,7 @@
NfsState = STATE_UMOUNT_REQ;
NfsSend ();
} else {
-#ifdef NFS_DEBUG
- printf ("Symlink --> %s\n", nfs_path);
-#endif
+ debug("Symlink --> %s\n", nfs_path);
nfs_filename = basename (nfs_path);
nfs_path = dirname (nfs_path);
@@ -696,9 +676,7 @@
void
NfsStart (void)
{
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
NfsDownloadState = NETLOOP_FAIL;
NfsServerIP = NetServerIP;