summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2011-01-01 15:20:20 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2011-01-01 15:20:20 +0000
commit43b2cac4ccac5f066e4ddee272aaf94a1c6cf95d (patch)
tree99296f6056200cfbc6f73d9640a3d4ad22612084 /sys/arch/hppa/dev
parentafed6da2484dda3c52606ffa46a8a10e29f6eb35 (diff)
Only store bus/dev/func numbers when the corresponding pointer argument
isn't NULL.
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/dino.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/hppa/dev/dino.c b/sys/arch/hppa/dev/dino.c
index 8a460806f8e..49c5e95c342 100644
--- a/sys/arch/hppa/dev/dino.c
+++ b/sys/arch/hppa/dev/dino.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dino.c,v 1.29 2010/12/04 17:06:31 miod Exp $ */
+/* $OpenBSD: dino.c,v 1.30 2011/01/01 15:20:19 kettenis Exp $ */
/*
* Copyright (c) 2003-2005 Michael Shalayeff
@@ -313,9 +313,12 @@ dino_make_tag(void *v, int bus, int dev, int func)
void
dino_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func)
{
- *bus = (tag >> 16) & 0xff;
- *dev = (tag >> 11) & 0x1f;
- *func= (tag >> 8) & 0x07;
+ if (bus)
+ *bus = (tag >> 16) & 0xff;
+ if (dev)
+ *dev = (tag >> 11) & 0x1f;
+ if (func)
+ *func= (tag >> 8) & 0x07;
}
int