Page MenuHomeFreeBSD

D53408.diff
No OneTemporary

D53408.diff

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
@@ -79,7 +79,7 @@
static int dpaa2_rc_enable_irq(struct dpaa2_mcp *, struct dpaa2_cmd *, uint8_t,
bool, uint16_t);
static int dpaa2_rc_configure_irq(device_t, device_t, int, uint64_t, uint32_t);
-static int dpaa2_rc_add_res(device_t, device_t, enum dpaa2_dev_type, int *, int);
+static int dpaa2_rc_add_res(device_t, device_t, enum dpaa2_dev_type, int, int);
static int dpaa2_rc_print_type(struct resource_list *, enum dpaa2_dev_type);
static struct dpaa2_mcp *dpaa2_rc_select_portal(device_t, device_t);
@@ -2890,7 +2890,7 @@
const char *devclass;
int dpio_n = 0; /* to limit DPIOs by # of CPUs */
int dpcon_n = 0; /* to limit DPCONs by # of CPUs */
- int rid, error;
+ int error;
rcdev = sc->dev;
rcinfo = device_get_ivars(rcdev);
@@ -2944,7 +2944,6 @@
for (; res_spec && res_spec->type != -1; res_spec++) {
if (res_spec->type < DPAA2_DEV_MC)
continue; /* Skip non-DPAA2 resource. */
- rid = res_spec->rid;
/* Limit DPIOs and DPCONs by number of CPUs. */
if (res_spec->type == DPAA2_DEV_IO && dpio_n >= mp_ncpus) {
@@ -2956,8 +2955,8 @@
continue;
}
- error = dpaa2_rc_add_res(rcdev, dev, res_spec->type, &rid,
- res_spec->flags);
+ error = dpaa2_rc_add_res(rcdev, dev, res_spec->type,
+ res_spec->rid, res_spec->flags);
if (error)
device_printf(rcdev, "%s: dpaa2_rc_add_res() failed: "
"error=%d\n", __func__, error);
@@ -2993,7 +2992,7 @@
const char *devclass;
uint64_t start, end, count;
uint32_t flags = 0;
- int rid, error;
+ int error;
rcdev = sc->dev;
child = sc->dev;
@@ -3088,10 +3087,9 @@
for (; res_spec && res_spec->type != -1; res_spec++) {
if (res_spec->type < DPAA2_DEV_MC)
continue; /* Skip non-DPAA2 resource. */
- rid = res_spec->rid;
- error = dpaa2_rc_add_res(rcdev, dev, res_spec->type, &rid,
- res_spec->flags);
+ error = dpaa2_rc_add_res(rcdev, dev, res_spec->type,
+ res_spec->rid, res_spec->flags);
if (error)
device_printf(rcdev, "%s: dpaa2_rc_add_res() failed: "
"error=%d\n", __func__, error);
@@ -3285,7 +3283,7 @@
*/
static int
dpaa2_rc_add_res(device_t rcdev, device_t child, enum dpaa2_dev_type devtype,
- int *rid, int flags)
+ int rid, int flags)
{
device_t dpaa2_dev;
struct dpaa2_devinfo *dinfo = device_get_ivars(child);
@@ -3297,7 +3295,7 @@
error = DPAA2_MC_GET_FREE_DEV(rcdev, &dpaa2_dev, devtype);
if (error && !(flags & RF_SHAREABLE)) {
device_printf(rcdev, "%s: failed to obtain a free %s (rid=%d) "
- "for: %s (id=%u)\n", __func__, dpaa2_ttos(devtype), *rid,
+ "for: %s (id=%u)\n", __func__, dpaa2_ttos(devtype), rid,
dpaa2_ttos(dinfo->dtype), dinfo->id);
return (error);
}
@@ -3308,7 +3306,7 @@
if (error) {
device_printf(rcdev, "%s: failed to obtain a shared "
"%s (rid=%d) for: %s (id=%u)\n", __func__,
- dpaa2_ttos(devtype), *rid, dpaa2_ttos(dinfo->dtype),
+ dpaa2_ttos(devtype), rid, dpaa2_ttos(dinfo->dtype),
dinfo->id);
return (error);
}
@@ -3316,16 +3314,16 @@
}
/* Add DPAA2 device to the resource list of the child device. */
- resource_list_add(&dinfo->resources, devtype, *rid,
+ resource_list_add(&dinfo->resources, devtype, rid,
(rman_res_t) dpaa2_dev, (rman_res_t) dpaa2_dev, 1);
/* Reserve a newly added DPAA2 resource. */
res = resource_list_reserve(&dinfo->resources, rcdev, child, devtype,
- *rid, (rman_res_t) dpaa2_dev, (rman_res_t) dpaa2_dev, 1,
+ rid, (rman_res_t) dpaa2_dev, (rman_res_t) dpaa2_dev, 1,
flags & ~RF_ACTIVE);
if (!res) {
device_printf(rcdev, "%s: failed to reserve %s (rid=%d) for: %s "
- "(id=%u)\n", __func__, dpaa2_ttos(devtype), *rid,
+ "(id=%u)\n", __func__, dpaa2_ttos(devtype), rid,
dpaa2_ttos(dinfo->dtype), dinfo->id);
return (EBUSY);
}
@@ -3336,7 +3334,7 @@
if (error) {
device_printf(rcdev, "%s: failed to reserve a shared "
"%s (rid=%d) for: %s (id=%u)\n", __func__,
- dpaa2_ttos(devtype), *rid, dpaa2_ttos(dinfo->dtype),
+ dpaa2_ttos(devtype), rid, dpaa2_ttos(dinfo->dtype),
dinfo->id);
return (error);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Jan 27, 12:27 PM (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24414259
Default Alt Text
D53408.diff (4 KB)

Event Timeline