[U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

Mike Frysinger vapier at gentoo.org
Tue Mar 1 09:58:46 CET 2011


On Tuesday, March 01, 2011 03:37:30 Michal Simek wrote:
> Mike Frysinger wrote:
> > On Monday, February 28, 2011 13:50:55 Michal Simek wrote:
> >> Mike Frysinger wrote:
> >>> On Monday, February 28, 2011 04:40:33 Michal Simek wrote:
> >>>> +	return 1;
> >>> 
> >>> a bunch of these funcs return 1 when i'm pretty sure they should be 0
> >> 
> >> init function is called from eth.c:eth_init(). From the code below you
> >> see that return can be >=0.
> > 
> > funny enough, that func in your patch is returning 0 when it should be 1.
> >  it doesnt explain why your recv/send are returning 1 when it should be
> > 0.
> 
> BTW: blackin emac recv functions return 0, -1 and length values.
> Is it correct?

looking at net/eth.c, -1 is an error return value.  add in current docs which 
says 0 is a success return value.  that leaves all other values as currently 
undocumented.  if a driver survey suggested that returning the length was 
useful info, then perhaps the documentation could be updated.  but as you 
noted, that return value isnt currently checked.

so for now, you could change the recv func to return the length rather than 0 
and i wouldnt complain, but always returning 1 is wrong.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110301/64a56b5f/attachment.pgp 


More information about the U-Boot mailing list