From b2735ac78382db6f10e2c1a21582733693b825bb Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 1 Jul 2010 03:20:40 +0000 Subject: Change scsibus(4)'s scsi_link array to an SLIST to save memory on sparsely populated buses. ok dlg@, krw@ --- sys/dev/ic/ciss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/dev/ic/ciss.c') diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 1e8c8782c4a..aa922917119 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.57 2010/06/28 18:31:02 krw Exp $ */ +/* $OpenBSD: ciss.c,v 1.58 2010/07/01 03:20:38 matthew Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -141,6 +141,7 @@ ciss_attach(struct ciss_softc *sc) struct ciss_ccb *ccb; struct ciss_cmd *cmd; struct ciss_inquiry *inq; + struct device *dev; bus_dma_segment_t seg[1]; int error, i, total, rseg, maxfer; ciss_lock_t lock; @@ -401,11 +402,10 @@ ciss_attach(struct ciss_softc *sc) sensor_attach(&sc->sensordev, &sc->sensors[i++])) { sc->sensors[i].type = SENSOR_DRIVE; sc->sensors[i].status = SENSOR_S_UNKNOWN; - strlcpy(sc->sensors[i].desc, ((struct device *) - scsibus->sc_link[i][0]->device_softc)->dv_xname, + dev = scsi_get_link(scsibus, i, 0)->device_softc; + strlcpy(sc->sensors[i].desc, dev->dv_xname, sizeof(sc->sensors[i].desc)); - strlcpy(sc->sc_lds[i]->xname, ((struct device *) - scsibus->sc_link[i][0]->device_softc)->dv_xname, + strlcpy(sc->sc_lds[i]->xname, dev->dv_xname, sizeof(sc->sc_lds[i]->xname)); } if (sensor_task_register(sc, ciss_sensors, 10) == NULL) -- cgit v1.2.3