diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-01-08 18:17:59 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-01-08 18:17:59 +0000 |
commit | 7f4f73db0d0dcdc8bbf4b1d7511a15e167837f22 (patch) | |
tree | 3752b299a6b63f21db1c2931fb5721952034abd1 /sys/arch/i386/pci | |
parent | e08885d3ca6ad79b4ca506bac3c963a02d10b78f (diff) |
replace magic numbers w/ a proper sizeof; from peter@
Diffstat (limited to 'sys/arch/i386/pci')
-rw-r--r-- | sys/arch/i386/pci/pcibios.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/pci/pcibios.c b/sys/arch/i386/pci/pcibios.c index a579aaf86d4..a4784398e20 100644 --- a/sys/arch/i386/pci/pcibios.c +++ b/sys/arch/i386/pci/pcibios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcibios.c,v 1.31 2005/01/04 21:19:15 espie Exp $ */ +/* $OpenBSD: pcibios.c,v 1.32 2005/01/08 18:17:58 mickey Exp $ */ /* $NetBSD: pcibios.c,v 1.5 2000/08/01 05:23:59 uch Exp $ */ /* @@ -297,13 +297,15 @@ pcibios_pir_init(sc) */ pcibios_pir_header = *pirh; pcibios_pir_table = - malloc(pirh->tablesize - 32, M_DEVBUF, M_NOWAIT); + malloc(pirh->tablesize - sizeof(*pirh), M_DEVBUF, M_NOWAIT); if (pcibios_pir_table == NULL) { printf("%s: no memory for $PIR\n", sc->sc_dev.dv_xname); return NULL; } - bcopy(p + 32, pcibios_pir_table, pirh->tablesize - 32); - pcibios_pir_table_nentries = (pirh->tablesize - 32) / 16; + bcopy(p + sizeof(*pirh), pcibios_pir_table, + pirh->tablesize - sizeof(*pirh)); + pcibios_pir_table_nentries = + (pirh->tablesize - sizeof(*pirh)) / 16; } |