summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_em.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2010-08-04 17:10:34 +0000
committerjsg <jsg@openbsd.org>2010-08-04 17:10:34 +0000
commit55c3514befed2b40cb475b48bd80d02b4b3ab205 (patch)
tree88b4a5e05cdf2866ec79855dff3eec840dbcbca9 /sys/dev/pci/if_em.c
parentPrint the MTU in OSPF dd packets. Borrowed from the ospf6 printer. (diff)
downloadwireguard-openbsd-55c3514befed2b40cb475b48bd80d02b4b3ab205.tar.xz
wireguard-openbsd-55c3514befed2b40cb475b48bd80d02b4b3ab205.zip
Correct a problem reported by Holger Mikolon that turns out to be
a bug in the initial EP80579 commit from dms that was exposed by gcc4. Lots of help tracking down the block of code at fault from Mike Belopuhov, but I spotted the problem in the end :) ok kettenis@ deraadt@
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r--sys/dev/pci/if_em.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 660a2711cde..5e58cef0277 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.242 2010/08/03 16:21:52 jsg Exp $ */
+/* $OpenBSD: if_em.c,v 1.243 2010/08/04 17:10:34 jsg Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -1648,12 +1648,11 @@ em_allocate_pci_resources(struct em_softc *sc)
* can confuse the system
*/
if(sc->hw.mac_type == em_icp_xxxx) {
- uint8_t offset;
+ int offset;
pcireg_t val;
if (!pci_get_capability(sc->osdep.em_pa.pa_pc,
- sc->osdep.em_pa.pa_tag, PCI_CAP_ID_ST, (int*) &offset,
- &val)) {
+ sc->osdep.em_pa.pa_tag, PCI_CAP_ID_ST, &offset, &val)) {
return (0);
}
offset += PCI_ST_SMIA_OFFSET;