[U-Boot] minor debug cleanups in ./net

Ben Warren biggerbadderben at gmail.com
Thu Jul 23 08:27:14 CEST 2009


Robin,

This won't apply:

bwarren at bwarren-bldsrv:~/src/u-boot-net$ git am -s --whitespace=strip ~/h_drive/patches/minor\ debug\ cleanups\ in\ ._net.eml
Applying minor debug cleanups in ./net
fatal: patch fragment without header at line 198: @@ -879,13 +856,13 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
Patch failed at 0001.
When you have resolved this problem run "git-am --resolved".
If you would prefer to skip this patch, instead run "git-am --skip".


More issues below:

Robin Getz wrote:

> From: Robin Getz <rgetz at blackfin.uclinux.org>
>
> 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 at blackfin.uclinux.org>
>
> ---
>
>   
<snip>
>  			/* matched waiting packet's address */
>  			if (tmp == NetArpWaitReplyIP) {
> -#ifdef ET_DEBUG
> -				puts ("Got it\n");
> +				debug("Got it\n");
>  #endif
>   
I'm guessing you want to remove this #endif too, right?
>  				/* save address for later use */
>  				memcpy(NetArpWaitPacketMAC, &arp->ar_data[0], 6);
> @@ -1317,16 +1295,14 @@ NetReceive(volatile uchar * inpkt, int len)
>  			}
>  			return;
>  		default:
> -#ifdef ET_DEBUG
> -			printf("Unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op));
> +			debug("Unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op));
>  #endif
>   
ditto
>  			return;
>  		}
>  		break;
>  
>  	case PROT_RARP:
> -#ifdef ET_DEBUG
> -		puts ("Got RARP\n");
> +		debug("Got RARP\n");
>  #endif
>   
And again...

<snip>

This is good stuff.  Please clean it up and re-submit.

regards,
Ben


More information about the U-Boot mailing list