diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-07-11 21:17:12 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-07-11 21:17:12 +0000 |
commit | 98d5938ca781a10b3b59e64274e0f432e2b178b4 (patch) | |
tree | 8dce3c3ce12f4deae2e60289f3a64078d749b6cc /sys/dev/ic | |
parent | 77058376e580f54a5366ad6438e9ad86dbfd88f7 (diff) |
Cache a scsibus_softc * and use it rather than cludging indirect
comparisons to sc_link.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/cac.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/cacvar.h | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index e5b0e03b114..20e60d3d417 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.61 2020/06/27 14:29:45 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.62 2020/07/11 21:17:11 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -247,7 +247,8 @@ cac_init(struct cac_softc *sc, int startfw) saa.saa_sc_link = &sc->sc_link; - config_found(&sc->sc_dv, &saa, scsiprint); + sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dv, &saa, + scsiprint); (*sc->sc_cl->cl_intr_enable)(sc, 1); @@ -892,7 +893,7 @@ cac_create_sensors(struct cac_softc *sc) /* check if this is the scsibus for the logical disks */ ssc = (struct scsibus_softc *)dev; - if (ssc->adapter_link == &sc->sc_link) + if (ssc == sc->sc_scsibus) break; ssc = NULL; } diff --git a/sys/dev/ic/cacvar.h b/sys/dev/ic/cacvar.h index 0138d43e284..4ea137f8724 100644 --- a/sys/dev/ic/cacvar.h +++ b/sys/dev/ic/cacvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cacvar.h,v 1.7 2013/05/30 16:15:02 deraadt Exp $ */ +/* $OpenBSD: cacvar.h,v 1.8 2020/07/11 21:17:11 krw Exp $ */ /* $NetBSD: cacvar.h,v 1.7 2000/10/19 14:28:47 ad Exp $ */ /*- @@ -101,6 +101,7 @@ struct cac_softc { int sc_nunits; void *sc_ih; struct scsi_link sc_link; + struct scsibus_softc *sc_scsibus; const struct cac_linkage *sc_cl; caddr_t sc_ccbs; paddr_t sc_ccbs_paddr; |