From mboxrd@z Thu Jan 1 00:00:00 1970 From: me@tobin.cc (Tobin C. Harding) Date: Tue, 14 Mar 2017 13:45:49 +1100 Subject: return codes In-Reply-To: <20170314020851.GA26463@kroah.com> References: <20170314020307.GC25311@eros> <20170314020851.GA26463@kroah.com> Message-ID: <20170314024549.GD25311@eros> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Mar 14, 2017 at 10:08:51AM +0800, Greg KH wrote: > On Tue, Mar 14, 2017 at 01:03:07PM +1100, Tobin C. Harding wrote: > > On investigating call sites for 'return' in drivers/staging/ks7010/ > > it can be seen that a number of functions us *custom* (positive) > > integers to indicate error. Notwithstanding that they are positive, is > > this ok for code in the kernel (i.e in order to get out of staging > > does this need to be changed)? Functions in question have internal linkage > > and the error code is used for debug messages. > > > > Should these be > > > > A) left alone > > B) made negative > > C) changed to use standard error codes (i.e -ENOMEM etc) > > C) please Awesome. thanks, Tobin.