From 7f4f73db0d0dcdc8bbf4b1d7511a15e167837f22 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Sat, 8 Jan 2005 18:17:59 +0000 Subject: replace magic numbers w/ a proper sizeof; from peter@ --- sys/arch/i386/pci/pcibios.c | 10 ++++++---- 1 file 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; } -- cgit v1.2.3