xpt_bus_register and xpt_bus_deregister have been an odd-duck in the CAMreturns a hybrid error that's
APIs.neither a cam_status, These routines return a cam_stutus in all casesnor an errno, except forbut a mix of both. Update
success, when CAM_SUCCESS isxpt_bus_register and xpt_bus_deregister to returned. However, an errno. CAM_SUCCESS isn'tThe vast
a useful cam_status, and is used only for this API.
Fix the API for these routines to always return a cam_status.majority of current users compare against zero, Fix allwhich can also be
users in the tree to test forspelled CAM_SUCCESS. Nobody uses CAM_CMP_REQ instead of CAM_SUCCESS.FAILURE, so remove that symbol
Remove CAM_SUCCESS and CAM_FAILURE to prevent their use (the latter was
unused). coccinelle was used to ensure that places that used != 0
in the numerous ways C allows were also changedto prevent comfusion (nothing returns it either).
Fix users ofWhere the API that store this value to store it in a cam_status,return value is saved, ensure that the variable 'error' is
anused to not treat it like an errno that can be returned. This is astore an errno and 'status' is used to store a cam_status where
kernel-only interface, but this change changes the ABI.
This commit should not be merged, and was done as one large commitit makes the code clearer (usually just in functions that already mix
rather than a few smaller ones to reinforce that notion (individualand match). Where the return value isn't used at all, avoid storing it
commits in a such a series would seem to be MFCable, but would fail
to work in hard to detect ways).
Sponsored by: Netflixat all.