diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-01 15:18:24 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-01 15:18:24 +0000 |
commit | afed6da2484dda3c52606ffa46a8a10e29f6eb35 (patch) | |
tree | a0aaee9e73ff4542fa655662c2fae9fcf5c0e40f /sys/arch | |
parent | a00e172e98d05cec564a9baae14c2d5cd159d75e (diff) |
Only store bus/dev/func numbers when the corresponding pointer argument
isn't NULL.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/dev/elroy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/hppa/dev/elroy.c b/sys/arch/hppa/dev/elroy.c index 21631ad4632..17018417931 100644 --- a/sys/arch/hppa/dev/elroy.c +++ b/sys/arch/hppa/dev/elroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elroy.c,v 1.8 2010/12/04 17:06:31 miod Exp $ */ +/* $OpenBSD: elroy.c,v 1.9 2011/01/01 15:18:23 kettenis Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -233,9 +233,12 @@ elroy_make_tag(void *v, int bus, int dev, int func) void elroy_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 |