summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2005-11-18 14:08:05 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2005-11-18 14:08:05 +0000
commit82da6d2a15ce8064ece35480e8877b0c6367b86a (patch)
treea751dd388c443b1f2bc98eb9ca66fde64352f361 /sys
parent41019b97cc8715203da28631864f7ea665b0527a (diff)
do not devide by zero
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ciss.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index 3bae70fd335..3aa0f1d7fa4 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.7 2005/09/07 04:00:16 mickey Exp $ */
+/* $OpenBSD: ciss.c,v 1.8 2005/11/18 14:08:04 mickey Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -360,7 +360,7 @@ ciss_attach(struct ciss_softc *sc)
sc->sc_link.device = &ciss_dev;
sc->sc_link.adapter_softc = sc;
- sc->sc_link.openings = sc->maxcmd / sc->maxunits; /* XXX */
+ sc->sc_link.openings = sc->maxcmd / (sc->maxunits? sc->maxunits : 1);
sc->sc_link.adapter = &ciss_switch;
sc->sc_link.adapter_target = sc->maxunits;
sc->sc_link.adapter_buswidth = sc->maxunits;
@@ -369,6 +369,7 @@ ciss_attach(struct ciss_softc *sc)
#if 0
sc->sc_link_raw.device = &ciss_raw_dev;
sc->sc_link_raw.adapter_softc = sc;
+ sc->sc_link.openings = sc->maxcmd / (sc->maxunits? sc->maxunits : 1);
sc->sc_link_raw.adapter = &ciss_raw_switch;
sc->sc_link_raw.adapter_target = sc->ndrives;
sc->sc_link_raw.adapter_buswidth = sc->ndrives;