HomeFreeBSD

cam: fix xpt_bus_register and xpt_bus_deregister return errno

Description

cam: fix xpt_bus_register and xpt_bus_deregister return errno

xpt_bus_register and xpt_bus_deregister returns a hybrid error that's
neither a cam_status, nor an errno, but a mix of both. Update
xpt_bus_register and xpt_bus_deregister to return an errno. The vast
majority of current users compare against zero, which can also be
spelled CAM_SUCCESS. Nobody uses CAM_FAILURE, so remove that symbol
to prevent comfusion (nothing returns it either).

Where the return value is saved, ensure that the variable 'error' is
used to store an errno and 'status' is used to store a cam_status where
it makes the code clearer (usually just in functions that already mix
and match). Where the return value isn't used at all, avoid storing it
at all.

Reviewed by: scottl@, mav@ (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30860

Details

Provenance
impAuthored on Jun 28 2021, 10:01 PM
Differential Revision
D30860: cam: fix xpt_bus_register and xpt_bus_deregister return errno
Parents
rGdcd5dea96509: cam: delete cam_sim_alloc_dev
Branches
Unknown
Tags
Unknown