Thread (11 messages) 11 messages, 4 authors, 2012-10-04

Advice on first patch

From: peter.senna@gmail.com (Peter Senna Tschudin)
Date: 2012-10-03 13:40:16

Matthew,

The file

drivers/net/wan/cosa.c

has many lines like:
return -1;

and
err = -1;
goto err_out;

Returning -1 is not the default way of returning error codes. Take a
look at http://lxr.free-electrons.com/source/include/asm-generic/errno-base.h
for a small list of error codes. There is also
http://lxr.free-electrons.com/source/include/asm-generic/errno.h.

If you decide to propose the use of error codes instead of -1, make
sure to update include section if needed. You can see how other
functions use return codes...

Peter

On Tue, Oct 2, 2012 at 12:56 PM,  [off-list ref] wrote:
I'm hopefully going to be submitting the attached patch to the mainline kernel tree, and as it's my first patch, I figured it would be wise to run it past KN first in case I'd done something monumentally stupid! I found it through a checkpatch run, from the excellent talk by GregKH at FOSDEM a year or so back.

Any input would be greatly appreciated!

Matthew Walster

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


-- 
Peter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help