Skip to content

Commit

Permalink
cam: prefer cam_sim_softc() over accessing cam_sim structure directly.
Browse files Browse the repository at this point in the history
Use the accessor function to get the softc for this sim. This also drops
an unneeded cast.

Sponsored by:		Netflix
Reviewed by:		mav@, hselasky@
Differential Revision:	https://reviews.freebsd.org/D30360
  • Loading branch information
bsdimp committed Jun 3, 2021
1 parent 95aa617 commit cc384c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sys/dev/firewire/sbp.c
Expand Up @@ -2273,7 +2273,7 @@ static void
sbp_action(struct cam_sim *sim, union ccb *ccb)
{

struct sbp_softc *sbp = (struct sbp_softc *)sim->softc;
struct sbp_softc *sbp = cam_sim_softc(sim);
struct sbp_target *target = NULL;
struct sbp_dev *sdev = NULL;

Expand Down Expand Up @@ -2632,7 +2632,7 @@ sbp_poll(struct cam_sim *sim)
struct sbp_softc *sbp;
struct firewire_comm *fc;

sbp = (struct sbp_softc *)sim->softc;
sbp = cam_sim_softc(sim);
fc = sbp->fd.fc;

fc->poll(fc, 0, -1);
Expand Down
4 changes: 2 additions & 2 deletions sys/dev/usb/storage/umass.c
Expand Up @@ -2157,7 +2157,7 @@ umass_cam_detach_sim(struct umass_softc *sc)
static void
umass_cam_action(struct cam_sim *sim, union ccb *ccb)
{
struct umass_softc *sc = (struct umass_softc *)sim->softc;
struct umass_softc *sc = cam_sim_softc(sim);

if (sc == NULL) {
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
Expand Down Expand Up @@ -2433,7 +2433,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
static void
umass_cam_poll(struct cam_sim *sim)
{
struct umass_softc *sc = (struct umass_softc *)sim->softc;
struct umass_softc *sc = cam_sim_softc(sim);

if (sc == NULL)
return;
Expand Down

0 comments on commit cc384c6

Please sign in to comment.