Skip to contentSkip to conversation

return codes

DISCUSSION Tobin C. Harding 2 participants 3 messages Mar 14, 2017

lore
Share & tools
lore
#0 lore raw

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)

thanks,
Tobin.

#1 lore raw
Quoted 7 lines · Tobin C. Harding

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.

Quoted 5 lines

Should these be

A) left alone
B) made negative
C) changed to use standard error codes (i.e -ENOMEM etc)

C) please

#2 lore raw
Quoted 8 lines · Greg KH
Quoted 7 lines · Tobin C. Harding

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.

Quoted 7 lines
Quoted 5 lines

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.