diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2005-12-12 09:39:30 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2005-12-12 09:39:30 +0000 |
commit | 24f5f89a593456ba244aa620022924fa18c75207 (patch) | |
tree | 69d9436015c78c19e585b96bd485486b8cc76f73 /sys | |
parent | a176f567cd79f3142d8d9090db0a130193b92e05 (diff) |
knf
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/amivar.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/ami_pci.c | 34 |
2 files changed, 17 insertions, 23 deletions
diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h index f1d8d239b07..2b656102f93 100644 --- a/sys/dev/ic/amivar.h +++ b/sys/dev/ic/amivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amivar.h,v 1.35 2005/12/10 12:03:24 dlg Exp $ */ +/* $OpenBSD: amivar.h,v 1.36 2005/12/12 09:39:29 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -92,11 +92,11 @@ struct ami_softc { void *sc_ih; struct scsi_link sc_link; -/* don't use 0x0001 */ + int sc_flags; +#define AMI_CHECK_SIGN 0x0001 #define AMI_BROKEN 0x0002 #define AMI_CMDWAIT 0x0004 #define AMI_QUARTZ 0x0008 - u_int sc_flags; /* low-level interface */ int (*sc_init)(struct ami_softc *sc); diff --git a/sys/dev/pci/ami_pci.c b/sys/dev/pci/ami_pci.c index c7aa9d1f343..c53bfe63ea5 100644 --- a/sys/dev/pci/ami_pci.c +++ b/sys/dev/pci/ami_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami_pci.c,v 1.32 2005/12/05 16:02:55 marco Exp $ */ +/* $OpenBSD: ami_pci.c,v 1.33 2005/12/12 09:39:29 dlg Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -75,7 +75,6 @@ struct ami_pci_device { int vendor; int product; int flags; -#define AMI_CHECK_SIGN 0x001 } ami_pci_devices[] = { { PCI_VENDOR_AMI, PCI_PRODUCT_AMI_MEGARAID, AMI_BROKEN }, { PCI_VENDOR_AMI, PCI_PRODUCT_AMI_MEGARAID428, AMI_BROKEN }, @@ -124,9 +123,8 @@ struct ami_pci_vendor { { 0 } }; -int ami_pci_find_device(aux) - void *aux; -{ +int +ami_pci_find_device(void *aux) { int i; struct pci_attach_args *pa = aux; @@ -144,10 +142,7 @@ int ami_pci_find_device(aux) } int -ami_pci_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; +ami_pci_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; int i; @@ -177,9 +172,7 @@ ami_pci_match(parent, match, aux) } void -ami_pci_attach(parent, self, aux) - struct device *parent, *self; - void *aux; +ami_pci_attach(struct device *parent, struct device *self, void *aux) { struct ami_softc *sc = (struct ami_softc *)self; struct pci_attach_args *pa = aux; @@ -243,7 +236,7 @@ ami_pci_attach(parent, self, aux) break; } - if (!model && PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMI) + if (!model && PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMI) { switch (PCI_PRODUCT(pa->pa_id)) { case PCI_PRODUCT_AMI_MEGARAID428: model = "AMI 428"; @@ -252,10 +245,12 @@ ami_pci_attach(parent, self, aux) model = "AMI 434"; break; } + } - /* XXX 438 is netraid 3si for hp cards, but we get to know - they are hp too late in md code */ - + /* + * XXX 438 is netraid 3si for hp cards, but we get to know + * they are hp too late in md code + */ if (!model) { const struct ami_pci_vendor *vp; static char modelbuf[32]; @@ -263,10 +258,10 @@ ami_pci_attach(parent, self, aux) for (vp = ami_pci_vendors; vp->id && vp->id != (csr & 0xffff); vp++); if (vp->id) - snprintf(modelbuf, sizeof modelbuf, "%s %x", vp->name, + snprintf(modelbuf, sizeof(modelbuf), "%s %x", vp->name, (csr >> 16) & 0xffff); else - snprintf(modelbuf, sizeof modelbuf, "unknown 0x%08x", + snprintf(modelbuf, sizeof(modelbuf), "unknown 0x%08x", csr); model = modelbuf; } @@ -280,8 +275,7 @@ ami_pci_attach(parent, self, aux) if ((i = ami_pci_find_device(aux)) != -1) { if (ami_pci_devices[i].flags & AMI_BROKEN) sc->sc_flags |= AMI_BROKEN; - } - else { + } else { /* this device existed at _match() should never happen */ panic("ami device dissapeared between match() and attach()"); } |