From 5ab05143219089c8a35caa12eab1ca5ed1de46e7 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 20 Nov 1999 14:56:55 +0000 Subject: [PATCH] Allow NULL for startp and/or countp in bus_get_resource() so that you can get one of the two without having to use a dummy variable. --- sys/dev/pci/pci.c | 6 ++++-- sys/isa/isa_common.c | 6 ++++-- sys/pccard/pccard_nbk.c | 6 ++++-- sys/pci/pci.c | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8cb59433c2e..4a36158c899 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1333,8 +1333,10 @@ pci_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index 42d486e940e..92027544859 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -869,8 +869,10 @@ isa_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/pccard/pccard_nbk.c b/sys/pccard/pccard_nbk.c index 264b96e2854..b0913633ddb 100644 --- a/sys/pccard/pccard_nbk.c +++ b/sys/pccard/pccard_nbk.c @@ -178,8 +178,10 @@ pccard_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 8cb59433c2e..4a36158c899 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -1333,8 +1333,10 @@ pci_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; }