summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-05 22:40:58 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-05 22:40:58 +0000
commite38ae7fb683c329831aba5bb5c866da618bcc03a (patch)
tree0713eecaec6e6965528fb65494eea7c833bbc635 /sys
parent302d3fe7606801c14a94fb7e9c22c90f96d1dc56 (diff)
Call bzero(&saa, sizeof(saa)) each time we use saa to attach
something. Doesn't matter right now because scsibus_attach_args only has one field and it's mandatory, but I'm planning to move some more fields from scsi_link to scsibus_attach_args+scsibus_softc. ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c7
-rw-r--r--sys/dev/pci/ips.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index fb51825ccbb..a184700170b 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.49 2011/07/04 22:17:23 matthew Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.50 2011/07/05 22:40:57 matthew Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -112,22 +112,25 @@ ahc_attach(struct ahc_softc *ahc)
if ((ahc->features & AHC_TWIN) && ahc->flags & AHC_RESET_BUS_B)
ahc_reset_channel(ahc, 'B', TRUE);
- bzero(&saa, sizeof(saa));
if ((ahc->flags & AHC_PRIMARY_CHANNEL) == 0) {
+ bzero(&saa, sizeof(saa));
saa.saa_sc_link = &ahc->sc_channel;
ahc->sc_child = config_found((void *)&ahc->sc_dev,
&saa, scsiprint);
if (ahc->features & AHC_TWIN) {
+ bzero(&saa, sizeof(saa));
saa.saa_sc_link = &ahc->sc_channel_b;
ahc->sc_child_b = config_found((void *)&ahc->sc_dev,
&saa, scsiprint);
}
} else {
if (ahc->features & AHC_TWIN) {
+ bzero(&saa, sizeof(saa));
saa.saa_sc_link = &ahc->sc_channel_b;
ahc->sc_child = config_found((void *)&ahc->sc_dev,
&saa, scsiprint);
}
+ bzero(&saa, sizeof(saa));
saa.saa_sc_link = &ahc->sc_channel;
ahc->sc_child_b = config_found((void *)&ahc->sc_dev,
&saa, scsiprint);
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c
index cf25765affc..46026c7a197 100644
--- a/sys/dev/pci/ips.c
+++ b/sys/dev/pci/ips.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ips.c,v 1.105 2011/04/06 15:33:15 dlg Exp $ */
+/* $OpenBSD: ips.c,v 1.106 2011/07/05 22:40:57 matthew Exp $ */
/*
* Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org>
@@ -743,7 +743,6 @@ ips_attach(struct device *parent, struct device *self, void *aux)
scsiprint);
/* For each channel attach SCSI pass-through bus */
- bzero(&saa, sizeof(saa));
for (i = 0; i < IPS_MAXCHANS; i++) {
struct ips_pt *pt;
struct scsi_link *link;
@@ -781,6 +780,7 @@ ips_attach(struct device *parent, struct device *self, void *aux)
link->adapter_softc = pt;
link->pool = &sc->sc_iopool;
+ bzero(&saa, sizeof(saa));
saa.saa_sc_link = link;
config_found(self, &saa, scsiprint);
}