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.
This commit is contained in:
Peter Wemm 1999-11-20 14:56:55 +00:00
parent 32fc781e06
commit 5ab0514321
4 changed files with 16 additions and 8 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}