git: cam: Fix xpt_bus_register()/xpt_bus_deregister() to return errno

Aaron LI aly at crater.dragonflybsd.org
Fri May 8 18:29:02 PDT 2026


commit 01f0d535335746036b9eb39c2f4be9661f70fbcb
Author: Aaron LI <aly at aaronly.me>
Date:   Fri May 8 20:25:42 2026 +0800

    cam: Fix xpt_bus_register()/xpt_bus_deregister() to 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.
    
    Obtained-from: FreeBSD (commit 30f8afd0270e0bb70e1e0df1cf8de7a841797a30)

Summary of changes:
 sys/bus/cam/cam_ccb.h                  |  1 -
 sys/bus/cam/cam_xpt.c                  | 15 ++++++++-------
 sys/bus/cam/cam_xpt_sim.h              |  4 ++--
 sys/bus/u4b/storage/umass.c            |  9 ++++++---
 sys/dev/disk/ahci/ahci_cam.c           |  2 +-
 sys/dev/disk/nata/atapi-cam.c          |  2 +-
 sys/dev/disk/sili/sili_cam.c           |  2 +-
 sys/dev/virtual/vmware/pvscsi/pvscsi.c |  8 ++++----
 8 files changed, 23 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/01f0d535335746036b9eb39c2f4be9661f70fbcb


-- 
DragonFly BSD source repository


More information about the Commits mailing list