Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146553506
D53402.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
84 KB
Referenced Files
None
Subscribers
None
D53402.id.diff
View Options
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -436,7 +436,7 @@
}
static struct resource *
-arm_gic_alloc_resource(device_t bus, device_t child, int type, int *rid,
+arm_gic_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct arm_gic_softc *sc;
@@ -458,11 +458,11 @@
if (type == SYS_RES_IOPORT)
type = SYS_RES_MEMORY;
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
- "rid = %d, type = %d\n", *rid, type);
+ "rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;
diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c
--- a/sys/arm/mv/mv_pci.c
+++ b/sys/arm/mv/mv_pci.c
@@ -343,7 +343,7 @@
static int mv_pcib_attach(device_t);
static struct rman *mv_pcib_get_rman(device_t, int, u_int);
-static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *,
+static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int mv_pcib_adjust_resource(device_t, device_t, struct resource *,
rman_res_t, rman_res_t);
@@ -905,7 +905,7 @@
}
static struct resource *
-mv_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+mv_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mv_pcib_softc *sc = device_get_softc(dev);
diff --git a/sys/arm/mv/mv_pci_ctrl.c b/sys/arm/mv/mv_pci_ctrl.c
--- a/sys/arm/mv/mv_pci_ctrl.c
+++ b/sys/arm/mv/mv_pci_ctrl.c
@@ -54,7 +54,7 @@
static device_t mv_pcib_ctrl_add_child(device_t, u_int, const char *, int);
static const struct ofw_bus_devinfo * mv_pcib_ctrl_get_devinfo(device_t, device_t);
static struct resource * mv_pcib_ctrl_alloc_resource(device_t, device_t, int,
- int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, rman_res_t, rman_res_t, rman_res_t, u_int);
void mv_pcib_ctrl_init(device_t, phandle_t);
static int mv_pcib_ofw_bus_attach(device_t);
@@ -236,7 +236,7 @@
}
static struct resource *
-mv_pcib_ctrl_alloc_resource(device_t bus, device_t child, int type, int *rid,
+mv_pcib_ctrl_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mv_pcib_ctrl_devinfo *di;
@@ -251,7 +251,7 @@
return (NULL);
/* Find defaults for this rid */
- rle = resource_list_find(&di->di_rl, type, *rid);
+ rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);
diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c
--- a/sys/arm64/arm64/gic_v3.c
+++ b/sys/arm64/arm64/gic_v3.c
@@ -539,7 +539,7 @@
}
static struct resource *
-gic_v3_alloc_resource(device_t bus, device_t child, int type, int *rid,
+gic_v3_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct gic_v3_softc *sc;
@@ -559,7 +559,7 @@
return (NULL);
/* Find defaults for this rid */
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -235,7 +235,7 @@
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
-nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+nexus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct nexus_device *ndev = DEVTONX(child);
@@ -250,7 +250,7 @@
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
- rle = resource_list_find(&ndev->nx_resources, type, *rid);
+ rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;
diff --git a/sys/arm64/cavium/thunder_pcie_common.h b/sys/arm64/cavium/thunder_pcie_common.h
--- a/sys/arm64/cavium/thunder_pcie_common.h
+++ b/sys/arm64/cavium/thunder_pcie_common.h
@@ -39,7 +39,7 @@
int thunder_pcie_identify_ecam(device_t, int *);
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *thunder_pcie_alloc_resource(device_t,
- device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ device_t, int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
#endif
#endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */
diff --git a/sys/arm64/cavium/thunder_pcie_common.c b/sys/arm64/cavium/thunder_pcie_common.c
--- a/sys/arm64/cavium/thunder_pcie_common.c
+++ b/sys/arm64/cavium/thunder_pcie_common.c
@@ -169,7 +169,7 @@
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *
-thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
+thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
pci_addr_t map, testval;
@@ -183,7 +183,7 @@
if (((type == SYS_RES_IOPORT) || (type == SYS_RES_MEMORY)) &&
RMAN_IS_DEFAULT_RANGE(start, end)) {
/* Read BAR manually to get resource address and size */
- pci_read_bar(child, *rid, &map, &testval, NULL);
+ pci_read_bar(child, rid, &map, &testval, NULL);
/* Mask the information bits */
if (PCI_BAR_MEM(map))
diff --git a/sys/arm64/cavium/thunder_pcie_fdt.c b/sys/arm64/cavium/thunder_pcie_fdt.c
--- a/sys/arm64/cavium/thunder_pcie_fdt.c
+++ b/sys/arm64/cavium/thunder_pcie_fdt.c
@@ -55,7 +55,7 @@
#ifdef THUNDERX_PASS_1_1_ERRATA
static struct resource * thunder_pcie_fdt_alloc_resource(device_t, device_t,
- int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pcie_fdt_release_resource(device_t, device_t,
struct resource*);
#endif
@@ -228,7 +228,7 @@
#ifdef THUNDERX_PASS_1_1_ERRATA
struct resource *
thunder_pcie_fdt_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct generic_pcie_fdt_softc *sc;
struct thunder_pcie_ofw_devinfo *di;
@@ -253,7 +253,7 @@
type = SYS_RES_MEMORY;
/* Find defaults for this rid */
- rle = resource_list_find(&di->di_rl, type, *rid);
+ rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c
--- a/sys/arm64/cavium/thunder_pcie_pem.c
+++ b/sys/arm64/cavium/thunder_pcie_pem.c
@@ -124,7 +124,7 @@
static int thunder_pem_adjust_resource(device_t, device_t,
struct resource *, rman_res_t, rman_res_t);
static struct resource * thunder_pem_alloc_resource(device_t, device_t, int,
- int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *);
static int thunder_pem_release_msi(device_t, device_t, int, int *);
static int thunder_pem_alloc_msix(device_t, device_t, int *);
@@ -651,7 +651,7 @@
}
static struct resource *
-thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
+thunder_pem_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct thunder_pem_softc *sc = device_get_softc(dev);
@@ -694,7 +694,7 @@
if (res == NULL && bootverbose) {
device_printf(dev, "%s FAIL: type=%d, rid=%d, "
"start=%016lx, end=%016lx, count=%016lx, flags=%x\n",
- __func__, type, *rid, start, end, count, flags);
+ __func__, type, rid, start, end, count, flags);
}
return (res);
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1562,7 +1562,7 @@
}
static struct resource *
-acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
+acpi_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
#ifndef INTRNG
@@ -1590,8 +1590,8 @@
* add the resource before allocating it. Note that these
* resources will not be reserved.
*/
- if (!isdefault && resource_list_find(rl, type, *rid) == NULL)
- resource_list_add(rl, type, *rid, start, end, count);
+ if (!isdefault && resource_list_find(rl, type, rid) == NULL)
+ resource_list_add(rl, type, rid, start, end, count);
res = resource_list_alloc(rl, bus, child, type, rid, start, end, count,
flags);
#ifndef INTRNG
@@ -1604,7 +1604,7 @@
*
* XXX: Should we handle the lookup failing?
*/
- if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares)))
+ if (ACPI_SUCCESS(acpi_lookup_irq_resource(child, rid, res, &ares)))
acpi_config_intr(child, &ares);
}
#endif
@@ -1616,7 +1616,7 @@
* system resource regions.
*/
if (res == NULL && isdefault) {
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle != NULL) {
start = rle->start;
end = rle->end;
diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c
--- a/sys/dev/acpica/acpi_pcib_acpi.c
+++ b/sys/dev/acpica/acpi_pcib_acpi.c
@@ -90,7 +90,7 @@
static int acpi_pcib_alloc_msix(device_t pcib, device_t dev,
int *irq);
static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev,
- device_t child, int type, int *rid,
+ device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
static int acpi_pcib_acpi_adjust_resource(device_t dev,
@@ -423,7 +423,7 @@
sc->ap_bus = start;
else {
rid = 0;
- bus_res = pci_domain_alloc_bus(sc->ap_segment, dev, &rid, 0,
+ bus_res = pci_domain_alloc_bus(sc->ap_segment, dev, rid, 0,
PCI_BUSMAX, 1, 0);
if (bus_res == NULL) {
device_printf(dev,
@@ -605,7 +605,7 @@
}
struct resource *
-acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
+acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct acpi_hpcib_softc *sc;
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -2025,7 +2025,7 @@
vga = device_get_parent(dev);
sc->sc_flush_page_rid = 100;
sc->sc_flush_page_res = BUS_ALLOC_RESOURCE(device_get_parent(vga), dev,
- SYS_RES_MEMORY, &sc->sc_flush_page_rid, start, end, PAGE_SIZE,
+ SYS_RES_MEMORY, sc->sc_flush_page_rid, start, end, PAGE_SIZE,
RF_ACTIVE);
if (sc->sc_flush_page_res == NULL) {
device_printf(dev, "Failed to allocate flush page at 0x%jx\n",
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -654,7 +654,7 @@
int ahci_detach(device_t dev);
int ahci_setup_interrupt(device_t dev);
int ahci_print_child(device_t dev, device_t child);
-struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ahci_release_resource(device_t dev, device_t child, struct resource *r);
int ahci_setup_intr(device_t dev, device_t child, struct resource *irq,
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -576,7 +576,7 @@
}
struct resource *
-ahci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ahci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ahci_controller *ctlr = device_get_softc(dev);
@@ -606,14 +606,14 @@
size = 128;
} else if ((ctlr->caps & AHCI_CAP_EMS) == 0) {
break;
- } else if (*rid == 0) {
+ } else if (rid == 0) {
offset = AHCI_EM_CTL;
size = 4;
} else {
offset = (ctlr->emloc & 0xffff0000) >> 14;
size = (ctlr->emloc & 0x0000ffff) << 2;
- if (*rid != 1) {
- if (*rid == 2 && (ctlr->capsem &
+ if (rid != 1) {
+ if (rid == 2 && (ctlr->capsem &
(AHCI_EM_XMT | AHCI_EM_SMB)) == 0)
offset += size;
else
@@ -634,7 +634,7 @@
}
break;
case SYS_RES_IRQ:
- if (*rid == ATA_IRQ_RID)
+ if (rid == ATA_IRQ_RID)
res = ctlr->irqs[0].r_irq;
break;
}
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h
--- a/sys/dev/ata/ata-pci.h
+++ b/sys/dev/ata/ata-pci.h
@@ -537,7 +537,7 @@
uint32_t val, int width);
int ata_pci_print_child(device_t dev, device_t child);
int ata_pci_child_location(device_t dev, device_t child, struct sbuf *sb);
-struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
+struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ata_pci_release_resource(device_t dev, device_t child, struct resource *r);
int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep);
int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -216,7 +216,7 @@
}
struct resource *
-ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ata_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -228,7 +228,7 @@
int myrid;
if (type == SYS_RES_IOPORT) {
- switch (*rid) {
+ switch (rid) {
case ATA_IOADDR_RID:
if (controller->legacy) {
start = (unit ? ATA_SECONDARY : ATA_PRIMARY);
@@ -237,7 +237,7 @@
}
myrid = PCIR_BAR(0) + (unit << 3);
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
- SYS_RES_IOPORT, &myrid,
+ SYS_RES_IOPORT, myrid,
start, end, count, flags);
break;
case ATA_CTLADDR_RID:
@@ -249,12 +249,12 @@
}
myrid = PCIR_BAR(1) + (unit << 3);
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
- SYS_RES_IOPORT, &myrid,
+ SYS_RES_IOPORT, myrid,
start, end, count, flags);
break;
}
}
- if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) {
+ if (type == SYS_RES_IRQ && rid == ATA_IRQ_RID) {
if (controller->legacy) {
int irq = (unit == 0 ? 14 : 15);
@@ -265,7 +265,7 @@
}
} else {
if (type == SYS_RES_IRQ) {
- if (*rid != ATA_IRQ_RID)
+ if (rid != ATA_IRQ_RID)
return (NULL);
res = controller->r_irq;
} else {
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c
--- a/sys/dev/atkbdc/atkbdc_isa.c
+++ b/sys/dev/atkbdc/atkbdc_isa.c
@@ -50,7 +50,7 @@
static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name,
int unit);
static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end,
+ int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int atkbdc_isa_release_resource(device_t dev, device_t child,
struct resource *r);
@@ -293,13 +293,13 @@
}
struct resource *
-atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid,
+atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
atkbdc_softc_t *sc;
sc = *(atkbdc_softc_t **)device_get_softc(dev);
- if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL)
+ if (type == SYS_RES_IRQ && rid == KBDC_RID_KBD && sc->irq != NULL)
return (sc->irq);
return (bus_generic_rl_alloc_resource(dev, child, type, rid, start,
end, count, flags));
diff --git a/sys/dev/bhnd/bhnd_subr.c b/sys/dev/bhnd/bhnd_subr.c
--- a/sys/dev/bhnd/bhnd_subr.c
+++ b/sys/dev/bhnd/bhnd_subr.c
@@ -2201,7 +2201,7 @@
res = NULL;
/* Allocate the real bus resource (without activating it) */
- res = BUS_ALLOC_RESOURCE(dev, child, type, rid, start, end, count,
+ res = BUS_ALLOC_RESOURCE(dev, child, type, *rid, start, end, count,
(flags & ~RF_ACTIVE));
if (res == NULL)
return (NULL);
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -937,7 +937,7 @@
*/
static struct resource *
bhndb_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct bhndb_softc *sc;
struct resource_list_entry *rle;
@@ -964,11 +964,11 @@
if (!passthrough && isdefault) {
/* Fetch the resource list entry. */
rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child),
- type, *rid);
+ type, rid);
if (rle == NULL) {
device_printf(dev,
"default resource %#x type %d for child %s "
- "not found\n", *rid, type,
+ "not found\n", rid, type,
device_get_nameunit(child));
return (NULL);
@@ -977,7 +977,7 @@
if (rle->res != NULL) {
device_printf(dev,
"resource entry %#x type %d for child %s is busy\n",
- *rid, type, device_get_nameunit(child));
+ rid, type, device_get_nameunit(child));
return (NULL);
}
@@ -997,17 +997,17 @@
if (rv == NULL)
return (NULL);
- rman_set_rid(rv, *rid);
+ rman_set_rid(rv, rid);
rman_set_type(rv, type);
/* Activate */
if (flags & RF_ACTIVE) {
- error = bus_activate_resource(child, type, *rid, rv);
+ error = bus_activate_resource(child, type, rid, rv);
if (error) {
device_printf(dev,
"failed to activate entry %#x type %d for "
"child %s: %d\n",
- *rid, type, device_get_nameunit(child), error);
+ rid, type, device_get_nameunit(child), error);
rman_release_resource(rv);
diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c
--- a/sys/dev/bhnd/cores/chipc/chipc.c
+++ b/sys/dev/bhnd/cores/chipc/chipc.c
@@ -765,7 +765,7 @@
static struct resource *
chipc_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct chipc_softc *sc;
struct chipc_region *cr;
@@ -793,11 +793,11 @@
if (!passthrough && isdefault) {
/* Fetch the resource list entry. */
rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child),
- type, *rid);
+ type, rid);
if (rle == NULL) {
device_printf(dev,
"default resource %#x type %d for child %s "
- "not found\n", *rid, type,
+ "not found\n", rid, type,
device_get_nameunit(child));
return (NULL);
}
@@ -806,7 +806,7 @@
device_printf(dev,
"resource entry %#x type %d for child %s is busy "
"[%d]\n",
- *rid, type, device_get_nameunit(child),
+ rid, type, device_get_nameunit(child),
rman_get_flags(rle->res));
return (NULL);
diff --git a/sys/dev/dpaa/fman.h b/sys/dev/dpaa/fman.h
--- a/sys/dev/dpaa/fman.h
+++ b/sys/dev/dpaa/fman.h
@@ -54,7 +54,7 @@
* @{
*/
struct resource * fman_alloc_resource(device_t bus, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int fman_activate_resource(device_t bus, device_t child,
struct resource *res);
int fman_release_resource(device_t bus, device_t child, struct resource *res);
diff --git a/sys/dev/dpaa/fman.c b/sys/dev/dpaa/fman.c
--- a/sys/dev/dpaa/fman.c
+++ b/sys/dev/dpaa/fman.c
@@ -148,7 +148,7 @@
}
struct resource *
-fman_alloc_resource(device_t bus, device_t child, int type, int *rid,
+fman_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct fman_softc *sc;
@@ -166,7 +166,7 @@
KASSERT(!(isdefault && passthrough),
("%s: passthrough of default allocation", __func__));
if (!passthrough) {
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);
KASSERT(rle->res == NULL,
@@ -189,10 +189,10 @@
end, count, flags & ~RF_ACTIVE, child);
if (res == NULL)
return (NULL);
- rman_set_rid(res, *rid);
+ rman_set_rid(res, rid);
rman_set_type(res, type);
if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(
- child, type, *rid, res) != 0) {
+ child, type, rid, res) != 0) {
rman_release_resource(res);
return (NULL);
}
diff --git a/sys/dev/dpaa2/dpaa2_mc.h b/sys/dev/dpaa2/dpaa2_mc.h
--- a/sys/dev/dpaa2/dpaa2_mc.h
+++ b/sys/dev/dpaa2/dpaa2_mc.h
@@ -181,7 +181,7 @@
struct rman *dpaa2_mc_rman(device_t mcdev, int type, u_int flags);
struct resource * dpaa2_mc_alloc_resource(device_t mcdev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
int dpaa2_mc_adjust_resource(device_t mcdev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end);
diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c
--- a/sys/dev/dpaa2/dpaa2_mc.c
+++ b/sys/dev/dpaa2/dpaa2_mc.c
@@ -300,7 +300,7 @@
*/
struct resource *
-dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int *rid,
+dpaa2_mc_alloc_resource(device_t mcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@@ -333,7 +333,7 @@
return (res);
fail:
device_printf(mcdev, "%s() failed: type=%d, rid=%d, start=%#jx, "
- "end=%#jx, count=%#jx, flags=%x\n", __func__, type, *rid, start, end,
+ "end=%#jx, count=%#jx, flags=%x\n", __func__, type, rid, start, end,
count, flags);
return (NULL);
}
diff --git a/sys/dev/dpaa2/dpaa2_rc.c b/sys/dev/dpaa2/dpaa2_rc.c
--- a/sys/dev/dpaa2/dpaa2_rc.c
+++ b/sys/dev/dpaa2/dpaa2_rc.c
@@ -225,7 +225,7 @@
}
static struct resource *
-dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int *rid,
+dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list *rl;
@@ -243,7 +243,7 @@
* dedicated software portal interrupt wire.
* See registers SWP_INTW0_CFG to SWP_INTW3_CFG for details.
*/
- if (type == SYS_RES_IRQ && *rid == 0)
+ if (type == SYS_RES_IRQ && rid == 0)
return (NULL);
return (resource_list_alloc(rl, rcdev, child, type, rid,
@@ -251,7 +251,7 @@
}
static struct resource *
-dpaa2_rc_alloc_resource(device_t rcdev, device_t child, int type, int *rid,
+dpaa2_rc_alloc_resource(device_t rcdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
if (device_get_parent(child) != rcdev)
diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c
--- a/sys/dev/exca/exca.c
+++ b/sys/dev/exca/exca.c
@@ -858,7 +858,7 @@
#if 0
static struct resource *
-exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int *rid,
+exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int rid,
u_long start, u_long end, u_long count, uint flags)
{
struct resource *res = NULL;
@@ -895,10 +895,10 @@
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL)
return (NULL);
- cbb_insert_res(sc, res, type, *rid);
+ cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE) {
- if (bus_activate_resource(child, type, *rid, res) != 0) {
- bus_release_resource(child, type, *rid, res);
+ if (bus_activate_resource(child, type, rid, res) != 0) {
+ bus_release_resource(child, type, rid, res);
return (NULL);
}
}
diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c
--- a/sys/dev/fdt/simplebus.c
+++ b/sys/dev/fdt/simplebus.c
@@ -45,7 +45,7 @@
*/
static int simplebus_probe(device_t dev);
static struct resource *simplebus_alloc_resource(device_t, device_t, int,
- int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, rman_res_t, rman_res_t, rman_res_t, u_int);
static void simplebus_probe_nomatch(device_t bus, device_t child);
static int simplebus_print_child(device_t bus, device_t child);
static device_t simplebus_add_child(device_t dev, u_int order,
@@ -431,7 +431,7 @@
}
static struct resource *
-simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+simplebus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct simplebus_softc *sc;
@@ -449,11 +449,11 @@
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
- rle = resource_list_find(&di->rl, type, *rid);
+ rle = resource_list_find(&di->rl, type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
- "rid = %d, type = %d\n", *rid, type);
+ "rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c
--- a/sys/dev/gpio/gpiobus.c
+++ b/sys/dev/gpio/gpiobus.c
@@ -864,7 +864,7 @@
}
static struct resource *
-gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+gpiobus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list *rl;
@@ -876,7 +876,7 @@
rl = BUS_GET_RESOURCE_LIST(bus, child);
if (rl == NULL)
return (NULL);
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;
diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c
--- a/sys/dev/hyperv/pcib/vmbus_pcib.c
+++ b/sys/dev/hyperv/pcib/vmbus_pcib.c
@@ -1663,7 +1663,7 @@
}
static struct resource *
-vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+vmbus_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
unsigned int bar_no;
@@ -1687,7 +1687,7 @@
if (!hpdev)
return (NULL);
- bar_no = PCI_RID2BAR(*rid);
+ bar_no = PCI_RID2BAR(rid);
if (bar_no >= MAX_NUM_BARS)
return (NULL);
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -92,7 +92,7 @@
uintptr_t *);
static int vmbus_child_pnpinfo(device_t, device_t, struct sbuf *);
static struct resource *vmbus_alloc_resource(device_t dev,
- device_t child, int type, int *rid,
+ device_t child, int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int vmbus_alloc_msi(device_t bus, device_t dev,
@@ -1062,7 +1062,7 @@
* For the release function, we can use bus_generic_release_resource().
*/
static struct resource *
-vmbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+vmbus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
device_t parent = device_get_parent(dev);
@@ -1346,7 +1346,7 @@
fb_start, fb_count, fb_height * fb_width);
hv_fb_res = pcib_host_res_alloc(&sc->vmbus_mmio_res, dev,
- SYS_RES_MEMORY, &rid, fb_start, fb_end, fb_count,
+ SYS_RES_MEMORY, rid, fb_start, fb_end, fb_count,
RF_ACTIVE | rman_make_alignment_flags(PAGE_SIZE));
if (hv_fb_res && bootverbose)
diff --git a/sys/dev/mvs/mvs_pci.c b/sys/dev/mvs/mvs_pci.c
--- a/sys/dev/mvs/mvs_pci.c
+++ b/sys/dev/mvs/mvs_pci.c
@@ -389,7 +389,7 @@
}
static struct resource *
-mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
+mvs_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -415,7 +415,7 @@
}
break;
case SYS_RES_IRQ:
- if (*rid == ATA_IRQ_RID)
+ if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}
diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c
--- a/sys/dev/mvs/mvs_soc.c
+++ b/sys/dev/mvs/mvs_soc.c
@@ -329,7 +329,7 @@
}
static struct resource *
-mvs_alloc_resource(device_t dev, device_t child, int type, int *rid,
+mvs_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mvs_controller *ctlr = device_get_softc(dev);
@@ -354,7 +354,7 @@
}
break;
case SYS_RES_IRQ:
- if (*rid == ATA_IRQ_RID)
+ if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}
diff --git a/sys/dev/ofw/ofw_pcib.c b/sys/dev/ofw/ofw_pcib.c
--- a/sys/dev/ofw/ofw_pcib.c
+++ b/sys/dev/ofw/ofw_pcib.c
@@ -66,7 +66,7 @@
*/
static struct rman *ofw_pcib_get_rman(device_t, int, u_int);
static struct resource * ofw_pcib_alloc_resource(device_t, device_t,
- int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, int, rman_res_t, rman_res_t, rman_res_t, u_int);
static int ofw_pcib_release_resource(device_t, device_t, struct resource *);
static int ofw_pcib_activate_resource(device_t, device_t, struct resource *);
static int ofw_pcib_deactivate_resource(device_t, device_t, struct resource *);
@@ -419,7 +419,7 @@
}
static struct resource *
-ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
+ofw_pcib_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ofw_pci_softc *sc;
diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c
--- a/sys/dev/ofw/ofwbus.c
+++ b/sys/dev/ofw/ofwbus.c
@@ -130,7 +130,7 @@
}
static struct resource *
-ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+ofwbus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *rv;
@@ -142,11 +142,11 @@
rle = NULL;
if (!passthrough && isdefault) {
rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child),
- type, *rid);
+ type, rid);
if (rle == NULL) {
if (bootverbose)
device_printf(bus, "no default resources for "
- "rid = %d, type = %d\n", *rid, type);
+ "rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -159,7 +159,7 @@
static int cbb_cardbus_deactivate_resource(device_t brdev,
device_t child, struct resource *res);
static struct resource *cbb_cardbus_alloc_resource(device_t brdev,
- device_t child, int type, int *rid, rman_res_t start,
+ device_t child, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags);
static int cbb_cardbus_release_resource(device_t brdev, device_t child,
struct resource *res);
@@ -1174,7 +1174,7 @@
static struct resource *
cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct cbb_softc *sc = device_get_softc(brdev);
int tmp;
@@ -1219,13 +1219,13 @@
res = BUS_ALLOC_RESOURCE(device_get_parent(brdev), child, type, rid,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL) {
- printf("cbb alloc res fail type %d rid %x\n", type, *rid);
+ printf("cbb alloc res fail type %d rid %x\n", type, rid);
return (NULL);
}
- cbb_insert_res(sc, res, type, *rid);
+ cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE)
- if (bus_activate_resource(child, type, *rid, res) != 0) {
- bus_release_resource(child, type, *rid, res);
+ if (bus_activate_resource(child, type, rid, res) != 0) {
+ bus_release_resource(child, type, rid, res);
return (NULL);
}
@@ -1338,7 +1338,7 @@
}
static struct resource *
-cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid,
+cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res = NULL;
@@ -1382,10 +1382,10 @@
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL)
return (NULL);
- cbb_insert_res(sc, res, type, *rid);
+ cbb_insert_res(sc, res, type, rid);
if (flags & RF_ACTIVE) {
- if (bus_activate_resource(child, type, *rid, res) != 0) {
- bus_release_resource(child, type, *rid, res);
+ if (bus_activate_resource(child, type, rid, res) != 0) {
+ bus_release_resource(child, type, rid, res);
return (NULL);
}
}
@@ -1475,7 +1475,7 @@
}
struct resource *
-cbb_alloc_resource(device_t brdev, device_t child, int type, int *rid,
+cbb_alloc_resource(device_t brdev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct cbb_softc *sc = device_get_softc(brdev);
diff --git a/sys/dev/pccbb/pccbb_pci.c b/sys/dev/pccbb/pccbb_pci.c
--- a/sys/dev/pccbb/pccbb_pci.c
+++ b/sys/dev/pccbb/pccbb_pci.c
@@ -749,7 +749,7 @@
}
static struct resource *
-cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
+cbb_pci_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct cbb_softc *sc;
diff --git a/sys/dev/pccbb/pccbbvar.h b/sys/dev/pccbb/pccbbvar.h
--- a/sys/dev/pccbb/pccbbvar.h
+++ b/sys/dev/pccbb/pccbbvar.h
@@ -110,7 +110,7 @@
int cbb_activate_resource(device_t brdev, device_t child,
struct resource *r);
struct resource *cbb_alloc_resource(device_t brdev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void cbb_child_detached(device_t brdev, device_t child);
int cbb_child_present(device_t parent, device_t child);
diff --git a/sys/dev/pci/hostb_pci.c b/sys/dev/pci/hostb_pci.c
--- a/sys/dev/pci/hostb_pci.c
+++ b/sys/dev/pci/hostb_pci.c
@@ -98,7 +98,7 @@
}
static struct resource *
-pci_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
+pci_hostb_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
diff --git a/sys/dev/pci/isa_pci.c b/sys/dev/pci/isa_pci.c
--- a/sys/dev/pci/isa_pci.c
+++ b/sys/dev/pci/isa_pci.c
@@ -52,7 +52,7 @@
static int isab_pci_probe(device_t dev);
static int isab_pci_attach(device_t dev);
static struct resource * isab_pci_alloc_resource(device_t dev,
- device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
+ device_t child, int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int isab_pci_release_resource(device_t dev, device_t child,
struct resource *r);
@@ -165,7 +165,7 @@
}
static struct resource *
-isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+isab_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct isab_pci_softc *sc;
@@ -182,7 +182,7 @@
* For BARs, we cache the resource so that we only allocate it
* from the PCI bus once.
*/
- bar = PCI_RID2BAR(*rid);
+ bar = PCI_RID2BAR(rid);
if (bar < 0 || bar > PCIR_MAX_BAR_0)
return (NULL);
sc = device_get_softc(dev);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -3914,7 +3914,7 @@
}
static struct resource *
-pci_alloc_secbus(device_t dev, device_t child, int *rid, rman_res_t start,
+pci_alloc_secbus(device_t dev, device_t child, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
@@ -3939,16 +3939,16 @@
return (NULL);
}
- if (*rid != 0)
+ if (rid != 0)
return (NULL);
- if (resource_list_find(rl, PCI_RES_BUS, *rid) == NULL)
- resource_list_add(rl, PCI_RES_BUS, *rid, start, end, count);
- if (!resource_list_reserved(rl, PCI_RES_BUS, *rid)) {
- res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, rid,
+ if (resource_list_find(rl, PCI_RES_BUS, rid) == NULL)
+ resource_list_add(rl, PCI_RES_BUS, rid, start, end, count);
+ if (!resource_list_reserved(rl, PCI_RES_BUS, rid)) {
+ res = resource_list_reserve(rl, dev, child, PCI_RES_BUS, &rid,
start, end, count, flags & ~RF_ACTIVE);
if (res == NULL) {
- resource_list_delete(rl, PCI_RES_BUS, *rid);
+ resource_list_delete(rl, PCI_RES_BUS, rid);
device_printf(child, "allocating %ju bus%s failed\n",
count, count == 1 ? "" : "es");
return (NULL);
@@ -5620,7 +5620,7 @@
}
struct resource *
-pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
+pci_alloc_multi_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_long num,
u_int flags)
{
@@ -5645,7 +5645,7 @@
* Can't alloc legacy interrupt once MSI messages have
* been allocated.
*/
- if (*rid == 0 && (cfg->msi.msi_alloc > 0 ||
+ if (rid == 0 && (cfg->msi.msi_alloc > 0 ||
cfg->msix.msix_alloc > 0))
return (NULL);
@@ -5654,7 +5654,7 @@
* routed and is deserving of an interrupt, try to
* assign it one.
*/
- if (*rid == 0 && !PCI_INTERRUPT_VALID(cfg->intline) &&
+ if (rid == 0 && !PCI_INTERRUPT_VALID(cfg->intline) &&
(cfg->intpin != 0))
pci_assign_interrupt(dev, child, 0);
break;
@@ -5666,7 +5666,7 @@
* tree.
*/
if (cfg->hdrtype == PCIM_HDRTYPE_BRIDGE) {
- switch (*rid) {
+ switch (rid) {
case PCIR_IOBASEL_1:
case PCIR_MEMBASE_1:
case PCIR_PMBASEL_1:
@@ -5679,9 +5679,9 @@
}
}
/* Reserve resources for this BAR if needed. */
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (rle == NULL) {
- res = pci_reserve_map(dev, child, type, rid, start, end,
+ res = pci_reserve_map(dev, child, type, &rid, start, end,
count, num, flags);
if (res == NULL)
return (NULL);
@@ -5692,7 +5692,7 @@
}
struct resource *
-pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
#ifdef PCI_IOV
diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h
--- a/sys/dev/pci/pci_host_generic.h
+++ b/sys/dev/pci/pci_host_generic.h
@@ -95,7 +95,7 @@
int pci_host_generic_core_attach(device_t);
int pci_host_generic_core_detach(device_t);
struct resource *pci_host_generic_core_alloc_resource(device_t, device_t, int,
- int *, rman_res_t, rman_res_t, rman_res_t, u_int);
+ int, rman_res_t, rman_res_t, rman_res_t, u_int);
int pci_host_generic_core_release_resource(device_t, device_t,
struct resource *);
int generic_pcie_read_ivar(device_t, device_t, int, uintptr_t *);
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -503,7 +503,7 @@
struct resource *
pci_host_generic_core_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct generic_pcie_core_softc *sc;
struct resource *res;
@@ -528,7 +528,7 @@
if (res == NULL) {
device_printf(dev, "%s FAIL: type=%d, rid=%d, "
"start=%016jx, end=%016jx, count=%016jx, flags=%x\n",
- __func__, type, *rid, start, end, count, flags);
+ __func__, type, rid, start, end, count, flags);
}
return (res);
}
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -350,7 +350,7 @@
rid = iov->iov_pos + PCIR_SRIOV_BAR(bar);
bar_size = 1 << bar_shift;
- res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, &rid, 0,
+ res = pci_alloc_multi_resource(bus, dev, SYS_RES_MEMORY, rid, 0,
~0, 1, iov->iov_num_vfs, RF_ACTIVE);
if (res == NULL)
@@ -1016,7 +1016,7 @@
}
struct resource *
-pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
+pci_vf_alloc_mem_resource(device_t dev, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
@@ -1031,7 +1031,7 @@
dinfo = device_get_ivars(child);
iov = dinfo->cfg.iov;
- map = pci_find_bar(child, *rid);
+ map = pci_find_bar(child, rid);
if (map == NULL)
return (NULL);
@@ -1055,21 +1055,21 @@
if (res == NULL)
return (NULL);
- rle = resource_list_add(&dinfo->resources, SYS_RES_MEMORY, *rid,
+ rle = resource_list_add(&dinfo->resources, SYS_RES_MEMORY, rid,
bar_start, bar_end, 1);
if (rle == NULL) {
rman_release_resource(res);
return (NULL);
}
- rman_set_rid(res, *rid);
+ rman_set_rid(res, rid);
rman_set_type(res, SYS_RES_MEMORY);
if (flags & RF_ACTIVE) {
- error = bus_activate_resource(child, SYS_RES_MEMORY, *rid, res);
+ error = bus_activate_resource(child, SYS_RES_MEMORY, rid, res);
if (error != 0) {
resource_list_delete(&dinfo->resources, SYS_RES_MEMORY,
- *rid);
+ rid);
rman_release_resource(res);
return (NULL);
}
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -695,7 +695,7 @@
}
static struct resource *
-pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
+pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@@ -708,9 +708,9 @@
if (bootverbose)
device_printf(bus->dev,
"allocated bus range (%ju-%ju) for rid %d of %s\n",
- rman_get_start(res), rman_get_end(res), *rid,
+ rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
- rman_set_rid(res, *rid);
+ rman_set_rid(res, rid);
rman_set_type(res, PCI_RES_BUS);
return (res);
}
@@ -745,7 +745,7 @@
}
struct resource *
-pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid,
+pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@@ -1661,7 +1661,7 @@
*/
static struct resource *
pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
- device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
+ device_t child, int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags)
{
struct resource *res;
@@ -1677,13 +1677,13 @@
if (bootverbose)
device_printf(sc->dev,
"allocated %s range (%#jx-%#jx) for rid %x of %s\n",
- w->name, rman_get_start(res), rman_get_end(res), *rid,
+ w->name, rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
- rman_set_rid(res, *rid);
+ rman_set_rid(res, rid);
rman_set_type(res, type);
if (flags & RF_ACTIVE) {
- if (bus_activate_resource(child, type, *rid, res) != 0) {
+ if (bus_activate_resource(child, type, rid, res) != 0) {
rman_release_resource(res);
return (NULL);
}
@@ -2032,7 +2032,7 @@
* is set up to, or capable of handling them.
*/
static struct resource *
-pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pcib_softc *sc;
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -151,11 +151,11 @@
rman_res_t count, u_int num, u_int flags);
struct resource *pci_alloc_multi_resource(device_t dev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end,
+ int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_long num, u_int flags);
struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child,
- int *rid, rman_res_t start, rman_res_t end,
+ int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int pci_vf_release_mem_resource(device_t dev, device_t child,
struct resource *r);
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -200,7 +200,7 @@
struct resource *
pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle;
struct resource *r;
@@ -241,7 +241,7 @@
device_printf(hr->hr_pcib,
"allocated type %d (%#jx-%#jx) for rid %x of %s\n",
type, rman_get_start(r), rman_get_end(r),
- *rid, pcib_child_name(dev));
+ rid, pcib_child_name(dev));
return (r);
}
}
@@ -327,7 +327,7 @@
}
struct resource *
-pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start,
+pci_domain_alloc_bus(int domain, device_t dev, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_domain *d;
@@ -341,7 +341,7 @@
if (res == NULL)
return (NULL);
- rman_set_rid(res, *rid);
+ rman_set_rid(res, rid);
rman_set_type(res, PCI_RES_BUS);
return (res);
}
diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h
--- a/sys/dev/pci/pcib_private.h
+++ b/sys/dev/pci/pcib_private.h
@@ -52,7 +52,7 @@
int pcib_host_res_decodes(struct pcib_host_resources *hr, int type,
rman_res_t start, rman_res_t end, u_int flags);
struct resource *pcib_host_res_alloc(struct pcib_host_resources *hr,
- device_t dev, int type, int *rid, rman_res_t start,
+ device_t dev, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags);
int pcib_host_res_adjust(struct pcib_host_resources *hr,
device_t dev, struct resource *r, rman_res_t start,
@@ -138,7 +138,7 @@
int host_pcib_get_busno(pci_read_config_fn read_config, int bus,
int slot, int func, uint8_t *busnum);
-struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid,
+struct resource *pci_domain_alloc_bus(int domain, device_t dev, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int pci_domain_adjust_bus(int domain, device_t dev,
struct resource *r, rman_res_t start, rman_res_t end);
@@ -149,7 +149,7 @@
int pci_domain_deactivate_bus(int domain, device_t dev,
struct resource *r);
struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void pcib_free_secbus(device_t dev, struct pcib_secbus *bus);
void pcib_setup_secbus(device_t dev, struct pcib_secbus *bus,
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -67,7 +67,7 @@
static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
static struct resource *vga_pci_alloc_resource(device_t dev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
static int vga_pci_release_resource(device_t dev, device_t child,
struct resource *r);
@@ -212,7 +212,7 @@
}
if (rid == 0)
return (NULL);
- res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0,
+ res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, rid, 0,
~0, 1, RF_ACTIVE);
if (res == NULL) {
@@ -246,7 +246,7 @@
/*
* re-allocate
*/
- res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0,
+ res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, rid, 0,
~0, 1, RF_ACTIVE);
if (res == NULL) {
device_printf(dev, "vga_pci_alloc_resource failed\n");
@@ -424,7 +424,7 @@
}
static struct resource *
-vga_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
+vga_pci_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct vga_resource *vr;
@@ -436,7 +436,7 @@
* For BARs, we cache the resource so that we only allocate it
* from the PCI bus once.
*/
- vr = lookup_res(device_get_softc(dev), *rid);
+ vr = lookup_res(device_get_softc(dev), rid);
if (vr == NULL)
return (NULL);
if (vr->vr_res == NULL)
diff --git a/sys/dev/ppc/ppc.c b/sys/dev/ppc/ppc.c
--- a/sys/dev/ppc/ppc.c
+++ b/sys/dev/ppc/ppc.c
@@ -1964,14 +1964,14 @@
* interrupt handlers.
*/
struct resource *
-ppc_alloc_resource(device_t bus, device_t child, int type, int *rid,
+ppc_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ppc_data *ppc = DEVTOSOFTC(bus);
switch (type) {
case SYS_RES_IRQ:
- if (*rid == 0)
+ if (rid == 0)
return (ppc->res_irq);
break;
}
diff --git a/sys/dev/ppc/ppcvar.h b/sys/dev/ppc/ppcvar.h
--- a/sys/dev/ppc/ppcvar.h
+++ b/sys/dev/ppc/ppcvar.h
@@ -41,7 +41,7 @@
int ppc_exec_microseq(device_t, struct ppb_microseq **);
struct resource *ppc_alloc_resource(device_t bus, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ppc_release_resource(device_t bus, device_t child, struct resource *r);
int ppc_reset_epp(device_t);
int ppc_ecp_sync(device_t);
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -469,7 +469,7 @@
}
struct resource *
-puc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+puc_bus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct puc_port *port;
@@ -487,7 +487,7 @@
port = device_get_ivars(child);
KASSERT(port != NULL, ("%s %d", __func__, __LINE__));
- if (rid == NULL || *rid != 0)
+ if (rid != 0)
return (NULL);
/* We only support default allocations. */
diff --git a/sys/dev/puc/puc_bfe.h b/sys/dev/puc/puc_bfe.h
--- a/sys/dev/puc/puc_bfe.h
+++ b/sys/dev/puc/puc_bfe.h
@@ -84,7 +84,7 @@
int puc_bus_child_location(device_t, device_t, struct sbuf *sb);
int puc_bus_child_pnpinfo(device_t, device_t, struct sbuf *sb);
-struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *,
+struct resource *puc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int puc_bus_print_child(device_t, device_t);
diff --git a/sys/dev/quicc/quicc_bfe.h b/sys/dev/quicc/quicc_bfe.h
--- a/sys/dev/quicc/quicc_bfe.h
+++ b/sys/dev/quicc/quicc_bfe.h
@@ -59,7 +59,7 @@
int quicc_bfe_detach(device_t);
int quicc_bfe_probe(device_t, u_int);
-struct resource *quicc_bus_alloc_resource(device_t, device_t, int, int *,
+struct resource *quicc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int quicc_bus_get_resource(device_t, device_t, int, int,
rman_res_t *, rman_res_t *);
diff --git a/sys/dev/quicc/quicc_core.c b/sys/dev/quicc/quicc_core.c
--- a/sys/dev/quicc/quicc_core.c
+++ b/sys/dev/quicc/quicc_core.c
@@ -251,7 +251,7 @@
}
struct resource *
-quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+quicc_bus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct quicc_device *qd;
@@ -265,7 +265,7 @@
return (NULL);
qd = device_get_ivars(child);
- rle = resource_list_find(&qd->qd_rlist, type, *rid);
+ rle = resource_list_find(&qd->qd_rlist, type, rid);
if (rle == NULL)
return (NULL);
diff --git a/sys/dev/scc/scc_bfe.h b/sys/dev/scc/scc_bfe.h
--- a/sys/dev/scc/scc_bfe.h
+++ b/sys/dev/scc/scc_bfe.h
@@ -141,7 +141,7 @@
int scc_bfe_detach(device_t dev);
int scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid);
-struct resource *scc_bus_alloc_resource(device_t, device_t, int, int *,
+struct resource *scc_bus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
int scc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
diff --git a/sys/dev/scc/scc_core.c b/sys/dev/scc/scc_core.c
--- a/sys/dev/scc/scc_core.c
+++ b/sys/dev/scc/scc_core.c
@@ -406,7 +406,7 @@
}
struct resource *
-scc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+scc_bus_alloc_resource(device_t dev, device_t child, int type, int rid __unused,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle;
@@ -425,7 +425,6 @@
rle = resource_list_find(&ch->ch_rlist, type, 0);
if (rle == NULL)
return (NULL);
- *rid = 0;
return (rle->res);
}
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -314,7 +314,7 @@
}
static struct resource *
-siis_alloc_resource(device_t dev, device_t child, int type, int *rid,
+siis_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct siis_controller *ctlr = device_get_softc(dev);
@@ -339,7 +339,7 @@
}
break;
case SYS_RES_IRQ:
- if (*rid == ATA_IRQ_RID)
+ if (rid == ATA_IRQ_RID)
res = ctlr->irq.r_irq;
break;
}
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c
--- a/sys/dev/sound/pci/csa.c
+++ b/sys/dev/sound/pci/csa.c
@@ -79,7 +79,7 @@
static int csa_probe(device_t dev);
static int csa_attach(device_t dev);
-static struct resource *csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
+static struct resource *csa_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int csa_release_resource(device_t bus, device_t child, struct resource *r);
@@ -353,7 +353,7 @@
}
static struct resource *
-csa_alloc_resource(device_t bus, device_t child, int type, int *rid,
+csa_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
sc_p scp;
@@ -364,12 +364,12 @@
resp = &scp->res;
switch (type) {
case SYS_RES_IRQ:
- if (*rid != 0)
+ if (rid != 0)
return (NULL);
res = resp->irq;
break;
case SYS_RES_MEMORY:
- switch (*rid) {
+ switch (rid) {
case PCIR_BAR(0):
res = resp->io;
break;
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -708,7 +708,7 @@
}
static struct resource *
-fm801_alloc_resource(device_t bus, device_t child, int type, int *rid,
+fm801_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -716,7 +716,7 @@
fm801 = pcm_getdevinfo(bus);
- if (type == SYS_RES_IOPORT && *rid == PCIR_BAR(0))
+ if (type == SYS_RES_IOPORT && rid == PCIR_BAR(0))
return (fm801->reg);
return (NULL);
diff --git a/sys/dev/spibus/acpi_spibus.c b/sys/dev/spibus/acpi_spibus.c
--- a/sys/dev/spibus/acpi_spibus.c
+++ b/sys/dev/spibus/acpi_spibus.c
@@ -416,7 +416,7 @@
#ifndef INTRNG
/* Mostly copy of acpi_alloc_resource() */
static struct resource *
-acpi_spibus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+acpi_spibus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
ACPI_RESOURCE ares;
@@ -434,7 +434,7 @@
res = resource_list_alloc(rl, dev, child, type, rid,
start, end, count, flags);
if (res != NULL && type == SYS_RES_IRQ &&
- ACPI_SUCCESS(acpi_lookup_irq_resource(child, *rid, res, &ares)))
+ ACPI_SUCCESS(acpi_lookup_irq_resource(child, rid, res, &ares)))
acpi_config_intr(child, &ares);
return (res);
diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c
--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
@@ -432,14 +432,14 @@
}
static struct resource *
-vmd_alloc_resource(device_t dev, device_t child, int type, int *rid,
+vmd_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
if (type == SYS_RES_IRQ) {
/* VMD hardware does not support legacy interrupts. */
- if (*rid == 0)
+ if (rid == 0)
return (NULL);
return (bus_generic_alloc_resource(dev, child, type, rid,
start, end, count, flags | RF_SHAREABLE));
@@ -451,13 +451,13 @@
case SYS_RES_MEMORY:
device_printf(dev,
"allocated memory range (%#jx-%#jx) for rid %d of %s\n",
- rman_get_start(res), rman_get_end(res), *rid,
+ rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
break;
case PCI_RES_BUS:
device_printf(dev,
"allocated bus range (%ju-%ju) for rid %d of %s\n",
- rman_get_start(res), rman_get_end(res), *rid,
+ rman_get_start(res), rman_get_end(res), rid,
pcib_child_name(child));
break;
}
diff --git a/sys/dev/vnic/mrml_bridge.c b/sys/dev/vnic/mrml_bridge.c
--- a/sys/dev/vnic/mrml_bridge.c
+++ b/sys/dev/vnic/mrml_bridge.c
@@ -49,7 +49,7 @@
static device_probe_t mrmlb_fdt_probe;
static device_attach_t mrmlb_fdt_attach;
-static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int *,
+static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static const struct ofw_bus_devinfo * mrmlb_ofw_get_devinfo(device_t, device_t);
@@ -128,7 +128,7 @@
}
static struct resource *
-mrmlb_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
+mrmlb_ofw_bus_alloc_res(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct simplebus_softc *sc;
@@ -143,7 +143,7 @@
type = SYS_RES_MEMORY;
/* Find defaults for this rid */
- rle = resource_list_find(&di->di_rl, type, *rid);
+ rle = resource_list_find(&di->di_rl, type, rid);
if (rle == NULL)
return (NULL);
diff --git a/sys/isa/isa_common.h b/sys/isa/isa_common.h
--- a/sys/isa/isa_common.h
+++ b/sys/isa/isa_common.h
@@ -69,7 +69,7 @@
*/
extern void isa_init(device_t dev);
extern struct resource *isa_alloc_resource(device_t bus, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
extern int isa_release_resource(device_t bus, device_t child,
struct resource *r);
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -480,7 +480,7 @@
STAILQ_FOREACH(rle, rl, link) {
if (!rle->res) {
rid = rle->rid;
- resource_list_alloc(rl, dev, child, rle->type, &rid,
+ resource_list_alloc(rl, dev, child, rle->type, rid,
0, ~0, 1, 0);
}
}
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -43,7 +43,7 @@
CODE {
static struct resource *
null_alloc_resource(device_t dev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end,
+ int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags)
{
return (0);
@@ -273,16 +273,15 @@
*
* This method is called by child devices of a bus to allocate resources.
* The types are defined in <machine/resource.h>; the meaning of the
- * resource-ID field varies from bus to bus (but @p *rid == 0 is always
- * valid if the resource type is). If a resource was allocated and the
- * caller did not use the RF_ACTIVE to specify that it should be
+ * resource-ID field varies from bus to bus. If a resource was allocated
+ * and the caller did not use the RF_ACTIVE to specify that it should be
* activated immediately, the caller is responsible for calling
* BUS_ACTIVATE_RESOURCE() when it actually uses the resource.
*
* @param _dev the parent device of @p _child
* @param _child the device which is requesting an allocation
* @param _type the type of resource to allocate
- * @param _rid a pointer to the resource identifier
+ * @param _rid the resource identifier
* @param _start hint at the start of the resource range - pass
* @c 0 for any start address
* @param _end hint at the end of the resource range - pass
@@ -300,7 +299,7 @@
device_t _dev;
device_t _child;
int _type;
- int *_rid;
+ int _rid;
rman_res_t _start;
rman_res_t _end;
rman_res_t _count;
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -3091,7 +3091,7 @@
panic(
"resource_list_reserve() should only reserve inactive resources");
- r = resource_list_alloc(rl, bus, child, type, rid, start, end, count,
+ r = resource_list_alloc(rl, bus, child, type, *rid, start, end, count,
flags);
if (r != NULL) {
rle = resource_list_find(rl, type, *rid);
@@ -3135,7 +3135,7 @@
*/
struct resource *
resource_list_alloc(struct resource_list *rl, device_t bus, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle = NULL;
int passthrough = (device_get_parent(child) != bus);
@@ -3146,7 +3146,7 @@
type, rid, start, end, count, flags));
}
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (!rle)
return (NULL); /* no resource of that type/rid */
@@ -3156,14 +3156,14 @@
if (rle->flags & RLE_ALLOCATED)
return (NULL);
if ((flags & RF_ACTIVE) &&
- bus_activate_resource(child, type, *rid,
+ bus_activate_resource(child, type, rid,
rle->res) != 0)
return (NULL);
rle->flags |= RLE_ALLOCATED;
return (rle->res);
}
device_printf(bus,
- "resource entry %#x type %d for child %s is busy\n", *rid,
+ "resource entry %#x type %d for child %s is busy\n", rid,
type, device_get_nameunit(child));
return (NULL);
}
@@ -4015,7 +4015,7 @@
* BUS_ALLOC_RESOURCE() method of the parent of @p dev.
*/
struct resource *
-bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid,
+bus_generic_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
/* Propagate up the bus hierarchy until someone handles it. */
@@ -4306,7 +4306,7 @@
*/
struct resource *
bus_generic_rl_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list * rl = NULL;
@@ -4331,7 +4331,7 @@
*/
struct resource *
bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+ int rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *r;
struct rman *rm;
@@ -4344,11 +4344,11 @@
child);
if (r == NULL)
return (NULL);
- rman_set_rid(r, *rid);
+ rman_set_rid(r, rid);
rman_set_type(r, type);
if (flags & RF_ACTIVE) {
- if (bus_activate_resource(child, type, *rid, r) != 0) {
+ if (bus_activate_resource(child, type, rid, r) != 0) {
rman_release_resource(r);
return (NULL);
}
@@ -4633,7 +4633,7 @@
* parent of @p dev.
*/
struct resource *
-(bus_alloc_resource)(device_t dev, int type, int *rid, rman_res_t start,
+(bus_alloc_resource)(device_t dev, int type, int rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
diff --git a/sys/powerpc/mpc85xx/isa.c b/sys/powerpc/mpc85xx/isa.c
--- a/sys/powerpc/mpc85xx/isa.c
+++ b/sys/powerpc/mpc85xx/isa.c
@@ -44,7 +44,7 @@
}
struct resource *
-isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
+isa_alloc_resource(device_t bus, device_t child, int type, int rid,
u_long start, u_long end, u_long count, u_int flags)
{
struct isa_device* idev = DEVTOISA(child);
@@ -55,17 +55,17 @@
passthrough = (device_get_parent(child) != bus) ? 1 : 0;
if (!passthrough && !isdefault &&
- resource_list_find(rl, type, *rid) == NULL) {
+ resource_list_find(rl, type, rid) == NULL) {
switch (type) {
case SYS_RES_IOPORT: rids = ISA_PNP_NPORT; break;
case SYS_RES_IRQ: rids = ISA_PNP_NIRQ; break;
case SYS_RES_MEMORY: rids = ISA_PNP_NMEM; break;
default: rids = 0; break;
}
- if (*rid < 0 || *rid >= rids)
+ if (rid < 0 || rid >= rids)
return (NULL);
- resource_list_add(rl, type, *rid, start, end, count);
+ resource_list_add(rl, type, rid, start, end, count);
}
return (resource_list_alloc(rl, bus, child, type, rid, start, end,
diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c
--- a/sys/powerpc/mpc85xx/lbc.c
+++ b/sys/powerpc/mpc85xx/lbc.c
@@ -78,7 +78,7 @@
static int lbc_deactivate_resource(device_t bus, device_t child,
struct resource *r);
static struct rman *lbc_get_rman(device_t, int, u_int);
-static struct resource *lbc_alloc_resource(device_t, device_t, int, int *,
+static struct resource *lbc_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int lbc_adjust_resource(device_t, device_t, struct resource *,
rman_res_t, rman_res_t);
@@ -697,7 +697,7 @@
}
static struct resource *
-lbc_alloc_resource(device_t bus, device_t child, int type, int *rid,
+lbc_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct lbc_devinfo *di;
@@ -721,16 +721,12 @@
if (type == SYS_RES_IOPORT)
type = SYS_RES_MEMORY;
- /*
- * XXX: We are supposed to return a value to the user, so this
- * doesn't seem right.
- */
- rid = &di->di_bank;
+ rid = di->di_bank;
- rle = resource_list_find(&di->di_res, type, *rid);
+ rle = resource_list_find(&di->di_res, type, rid);
if (rle == NULL) {
device_printf(bus, "no default resources for "
- "rid = %d, type = %d\n", *rid, type);
+ "rid = %d, type = %d\n", rid, type);
return (NULL);
}
start = rle->start;
diff --git a/sys/powerpc/powermac/macgpio.c b/sys/powerpc/powermac/macgpio.c
--- a/sys/powerpc/powermac/macgpio.c
+++ b/sys/powerpc/powermac/macgpio.c
@@ -69,7 +69,7 @@
static int macgpio_attach(device_t);
static int macgpio_print_child(device_t dev, device_t child);
static void macgpio_probe_nomatch(device_t, device_t);
-static struct resource *macgpio_alloc_resource(device_t, device_t, int, int *,
+static struct resource *macgpio_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
static int macgpio_activate_resource(device_t, device_t,
struct resource *);
@@ -260,7 +260,7 @@
}
static struct resource *
-macgpio_alloc_resource(device_t bus, device_t child, int type, int *rid,
+macgpio_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c
--- a/sys/powerpc/powermac/macio.c
+++ b/sys/powerpc/powermac/macio.c
@@ -81,7 +81,7 @@
static int macio_print_child(device_t dev, device_t child);
static void macio_probe_nomatch(device_t, device_t);
static struct rman *macio_get_rman(device_t, int, u_int);
-static struct resource *macio_alloc_resource(device_t, device_t, int, int *,
+static struct resource *macio_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int macio_adjust_resource(device_t, device_t, struct resource *,
@@ -521,7 +521,7 @@
}
static struct resource *
-macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
+macio_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -535,10 +535,10 @@
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rle = resource_list_find(&dinfo->mdi_resources, SYS_RES_MEMORY,
- *rid);
+ rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
- device_get_nameunit(child), *rid);
+ device_get_nameunit(child), rid);
return (NULL);
}
@@ -568,7 +568,7 @@
type, rid, start, end, count, flags);
rle = resource_list_find(&dinfo->mdi_resources, SYS_RES_IRQ,
- *rid);
+ rid);
if (rle == NULL) {
if (dinfo->mdi_ninterrupts >= 6) {
device_printf(bus,
diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c
--- a/sys/powerpc/powermac/uninorth.c
+++ b/sys/powerpc/powermac/uninorth.c
@@ -72,7 +72,7 @@
static int unin_chip_print_child(device_t dev, device_t child);
static void unin_chip_probe_nomatch(device_t, device_t);
static struct rman *unin_chip_get_rman(device_t, int, u_int);
-static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *,
+static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t,
rman_res_t, u_int);
static int unin_chip_adjust_resource(device_t, device_t,
@@ -478,7 +478,7 @@
}
static struct resource *
-unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid,
+unin_chip_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -492,10 +492,10 @@
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rle = resource_list_find(&dinfo->udi_resources, SYS_RES_MEMORY,
- *rid);
+ rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
- device_get_nameunit(child), *rid);
+ device_get_nameunit(child), rid);
return (NULL);
}
@@ -527,7 +527,7 @@
flags);
rle = resource_list_find(&dinfo->udi_resources, SYS_RES_IRQ,
- *rid);
+ rid);
if (rle == NULL) {
if (dinfo->udi_ninterrupts >= 6) {
device_printf(bus,
diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c
--- a/sys/powerpc/ps3/ps3bus.c
+++ b/sys/powerpc/ps3/ps3bus.c
@@ -59,7 +59,7 @@
uintptr_t *result);
static struct rman *ps3bus_get_rman(device_t bus, int type, u_int flags);
static struct resource *ps3bus_alloc_resource(device_t bus, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end,
+ int type, int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
static int ps3bus_map_resource(device_t bus, device_t child,
struct resource *r, struct resource_map_request *argsp,
@@ -548,7 +548,7 @@
}
static struct resource *
-ps3bus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+ps3bus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct ps3bus_devinfo *dinfo;
@@ -560,10 +560,10 @@
switch (type) {
case SYS_RES_MEMORY:
rle = resource_list_find(&dinfo->resources, SYS_RES_MEMORY,
- *rid);
+ rid);
if (rle == NULL) {
device_printf(bus, "no rle for %s memory %d\n",
- device_get_nameunit(child), *rid);
+ device_get_nameunit(child), rid);
return (NULL);
}
@@ -585,7 +585,7 @@
break;
case SYS_RES_IRQ:
rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ,
- *rid);
+ rid);
adjstart = rle->start;
adjcount = ulmax(count, rle->count);
adjend = ulmax(rle->end, rle->start + adjcount - 1);
diff --git a/sys/powerpc/psim/ata_iobus.c b/sys/powerpc/psim/ata_iobus.c
--- a/sys/powerpc/psim/ata_iobus.c
+++ b/sys/powerpc/psim/ata_iobus.c
@@ -58,7 +58,7 @@
static int ata_iobus_attach(device_t dev);
static int ata_iobus_probe(device_t dev);
static int ata_iobus_print_child(device_t dev, device_t child);
-struct resource *ata_iobus_alloc_resource(device_t, device_t, int, int *,
+struct resource *ata_iobus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int ata_iobus_release_resource(device_t, device_t, struct resource *);
@@ -129,7 +129,7 @@
}
struct resource *
-ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+ata_iobus_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -152,14 +152,14 @@
* The resource values are calculated from these registers
*/
if (type == SYS_RES_IOPORT) {
- switch (*rid) {
+ switch (rid) {
case ATA_IOADDR_RID:
myrid = 0;
start = ofw_regs[4];
end = start + ATA_IOSIZE - 1;
count = ATA_IOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
- SYS_RES_MEMORY, &myrid,
+ SYS_RES_MEMORY, myrid,
start, end, count, flags);
break;
@@ -169,7 +169,7 @@
end = start + ATA_CTLIOSIZE - 1;
count = ATA_CTLIOSIZE;
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
- SYS_RES_MEMORY, &myrid,
+ SYS_RES_MEMORY, myrid,
start, end, count, flags);
break;
@@ -179,7 +179,7 @@
}
return (res);
- } else if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) {
+ } else if (type == SYS_RES_IRQ && rid == ATA_IRQ_RID) {
/*
* Pass this on to the parent
*/
diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c
--- a/sys/powerpc/psim/iobus.c
+++ b/sys/powerpc/psim/iobus.c
@@ -71,7 +71,7 @@
static int iobus_read_ivar(device_t, device_t, int, uintptr_t *);
static int iobus_write_ivar(device_t, device_t, int, uintptr_t);
static struct rman *iobus_get_rman(device_t, int, u_int);
-static struct resource *iobus_alloc_resource(device_t, device_t, int, int *,
+static struct resource *iobus_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t,
u_int);
static int iobus_adjust_resource(device_t, device_t, struct resource *,
@@ -319,7 +319,7 @@
}
static struct resource *
-iobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+iobus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c
--- a/sys/riscv/riscv/nexus.c
+++ b/sys/riscv/riscv/nexus.c
@@ -226,7 +226,7 @@
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
-nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+nexus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct nexus_device *ndev = DEVTONX(child);
@@ -241,7 +241,7 @@
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
- rle = resource_list_find(&ndev->nx_resources, type, *rid);
+ rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -381,7 +381,7 @@
struct resource *
resource_list_alloc(struct resource_list *rl,
device_t bus, device_t child,
- int type, int *rid,
+ int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int resource_list_release(struct resource_list *rl,
@@ -427,7 +427,7 @@
rman_res_t end);
struct resource *
bus_generic_alloc_resource(device_t bus, device_t child, int type,
- int *rid, rman_res_t start, rman_res_t end,
+ int rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int bus_generic_translate_resource(device_t dev, int type, rman_res_t start,
rman_res_t *newstart);
@@ -480,7 +480,7 @@
void *arg, void **cookiep);
struct resource *
- bus_generic_rl_alloc_resource(device_t, device_t, int, int *,
+ bus_generic_rl_alloc_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t, rman_res_t, u_int);
void bus_generic_rl_delete_resource(device_t, device_t, int, int);
int bus_generic_rl_get_resource(device_t, device_t, int, int, rman_res_t *,
@@ -490,7 +490,7 @@
int bus_generic_rl_release_resource(device_t, device_t, struct resource *);
struct resource *
bus_generic_rman_alloc_resource(device_t dev, device_t child, int type,
- int *rid, rman_res_t start,
+ int rid, rman_res_t start,
rman_res_t end, rman_res_t count,
u_int flags);
int bus_generic_rman_adjust_resource(device_t dev, device_t child,
@@ -544,7 +544,7 @@
rman_res_t start, rman_res_t end);
int bus_translate_resource(device_t child, int type, rman_res_t start,
rman_res_t *newstart);
-struct resource *bus_alloc_resource(device_t dev, int type, int *rid,
+struct resource *bus_alloc_resource(device_t dev, int type, int rid,
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int bus_activate_resource(device_t dev, struct resource *r);
@@ -588,13 +588,13 @@
void bus_identify_children(device_t dev);
static __inline struct resource *
-bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags)
+bus_alloc_resource_any(device_t dev, int type, int rid, u_int flags)
{
return (bus_alloc_resource(dev, type, rid, 0, ~0, 1, flags));
}
static __inline struct resource *
-bus_alloc_resource_anywhere(device_t dev, int type, int *rid,
+bus_alloc_resource_anywhere(device_t dev, int type, int rid,
rman_res_t count, u_int flags)
{
return (bus_alloc_resource(dev, type, rid, 0, ~0, count, flags));
@@ -602,44 +602,44 @@
/* Compat shims for bus_alloc_resource API. */
static __inline struct resource *
-bus_alloc_resource_const(device_t dev, int type, int rid, rman_res_t start,
+bus_alloc_resource_var(device_t dev, int type, int *rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
- return (bus_alloc_resource(dev, type, &rid, start, end, count, flags));
+ return (bus_alloc_resource(dev, type, *rid, start, end, count, flags));
}
static __inline struct resource *
-bus_alloc_resource_any_const(device_t dev, int type, int rid, u_int flags)
+bus_alloc_resource_any_var(device_t dev, int type, int *rid, u_int flags)
{
- return (bus_alloc_resource(dev, type, &rid, 0, ~0, 1, flags));
+ return (bus_alloc_resource(dev, type, *rid, 0, ~0, 1, flags));
}
static __inline struct resource *
-bus_alloc_resource_anywhere_const(device_t dev, int type, int rid,
+bus_alloc_resource_anywhere_var(device_t dev, int type, int *rid,
rman_res_t count, u_int flags)
{
- return (bus_alloc_resource(dev, type, &rid, 0, ~0, count, flags));
+ return (bus_alloc_resource(dev, type, *rid, 0, ~0, count, flags));
}
#define bus_alloc_resource(dev, type, rid, start, end, count, flags) \
_Generic((rid), \
- int *: bus_alloc_resource, \
- unsigned int *: bus_alloc_resource, \
- default: bus_alloc_resource_const) \
+ int *: bus_alloc_resource_var, \
+ unsigned int *: bus_alloc_resource_var, \
+ default: bus_alloc_resource) \
((dev), (type), (rid), (start), (end), (count), (flags))
#define bus_alloc_resource_any(dev, type, rid, flags) \
_Generic((rid), \
- int *: bus_alloc_resource_any, \
- unsigned int *: bus_alloc_resource_any, \
- default: bus_alloc_resource_any_const) \
+ int *: bus_alloc_resource_any_var, \
+ unsigned int *: bus_alloc_resource_any_var, \
+ default: bus_alloc_resource_any) \
((dev), (type), (rid), (flags))
#define bus_alloc_resource_anywhere(dev, type, rid, count, flags) \
_Generic((rid), \
- int *: bus_alloc_resource_anywhere, \
- unsigned int *: bus_alloc_resource_anywhere, \
- default: bus_alloc_resource_anywhere_const) \
+ int *: bus_alloc_resource_anywhere_var, \
+ unsigned int *: bus_alloc_resource_anywhere_var, \
+ default: bus_alloc_resource_anywhere) \
((dev), (type), (rid), (count), (flags))
/* Compat shims for simpler bus resource API. */
diff --git a/sys/x86/include/legacyvar.h b/sys/x86/include/legacyvar.h
--- a/sys/x86/include/legacyvar.h
+++ b/sys/x86/include/legacyvar.h
@@ -56,7 +56,7 @@
int legacy_pcib_write_ivar(device_t dev, device_t child, int which,
uintptr_t value);
struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child,
- int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
int legacy_pcib_adjust_resource(device_t dev, device_t child,
struct resource *r, rman_res_t start, rman_res_t end);
diff --git a/sys/x86/isa/isa.c b/sys/x86/isa/isa.c
--- a/sys/x86/isa/isa.c
+++ b/sys/x86/isa/isa.c
@@ -84,7 +84,7 @@
* necessary to interpose a mapping layer here.
*/
struct resource *
-isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
+isa_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
/*
@@ -97,31 +97,31 @@
struct resource_list_entry *rle;
if (!passthrough && !isdefault) {
- rle = resource_list_find(rl, type, *rid);
+ rle = resource_list_find(rl, type, rid);
if (!rle) {
- if (*rid < 0)
+ if (rid < 0)
return 0;
switch (type) {
case SYS_RES_IRQ:
- if (*rid >= ISA_NIRQ)
+ if (rid >= ISA_NIRQ)
return 0;
break;
case SYS_RES_DRQ:
- if (*rid >= ISA_NDRQ)
+ if (rid >= ISA_NDRQ)
return 0;
break;
case SYS_RES_MEMORY:
- if (*rid >= ISA_NMEM)
+ if (rid >= ISA_NMEM)
return 0;
break;
case SYS_RES_IOPORT:
- if (*rid >= ISA_NPORT)
+ if (rid >= ISA_NPORT)
return 0;
break;
default:
return 0;
}
- resource_list_add(rl, type, *rid, start, end, count);
+ resource_list_add(rl, type, rid, start, end, count);
}
}
diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c
--- a/sys/x86/pci/pci_bus.c
+++ b/sys/x86/pci/pci_bus.c
@@ -592,7 +592,7 @@
}
struct resource *
-legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c
--- a/sys/x86/pci/qpi.c
+++ b/sys/x86/pci/qpi.c
@@ -249,7 +249,7 @@
}
static struct resource *
-qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
+qpi_pcib_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
diff --git a/sys/x86/x86/mptable_pci.c b/sys/x86/x86/mptable_pci.c
--- a/sys/x86/x86/mptable_pci.c
+++ b/sys/x86/x86/mptable_pci.c
@@ -96,7 +96,7 @@
}
static struct resource *
-mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
+mptable_hostb_alloc_resource(device_t dev, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct mptable_hostb_softc *sc;
diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c
--- a/sys/x86/x86/nexus.c
+++ b/sys/x86/x86/nexus.c
@@ -345,7 +345,7 @@
* child of one of our descendants, not a direct child of nexus0.
*/
static struct resource *
-nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
+nexus_alloc_resource(device_t bus, device_t child, int type, int rid,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags)
{
@@ -361,7 +361,7 @@
if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return (NULL);
- rle = resource_list_find(&ndev->nx_resources, type, *rid);
+ rle = resource_list_find(&ndev->nx_resources, type, rid);
if (rle == NULL)
return (NULL);
start = rle->start;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 4, 2:50 PM (15 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29211917
Default Alt Text
D53402.id.diff (84 KB)
Attached To
Mode
D53402: bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHOD
Attached
Detach File
Event Timeline
Log In to Comment