summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-08-24 02:47:01 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-08-24 02:47:01 +0000
commitc1b8161326a0bd4085ca91ba4681ce5fb734a812 (patch)
tree0157e681c3da53e278a3f1ea19dbf37e52fbc602
parent7ab2cd8c3826e1e5fd390e513aeefbd9f12f4af5 (diff)
Notes
-rw-r--r--sys/cam/cam_periph.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 7ffc1c56b199..48d26e705c5a 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -363,34 +363,33 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid,
target_id_t target, lun_id_t lun)
{
u_int unit;
- int hit, i, val, dunit;
+ int wired, i, val, dunit;
const char *dname, *strval;
char pathbuf[32], *periph_name;
- unit = 0;
- hit = 0;
-
periph_name = p_drv->driver_name;
snprintf(pathbuf, sizeof(pathbuf), "scbus%d", pathid);
+ unit = 0;
i = 0;
dname = periph_name;
- while ((resource_find_dev(&i, dname, &dunit, NULL, NULL)) == 0) {
+ for (wired = 0; resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0;
+ wired = 0) {
if (resource_string_value(dname, dunit, "at", &strval) == 0) {
if (strcmp(strval, pathbuf) != 0)
continue;
- hit++;
+ wired++;
}
if (resource_int_value(dname, dunit, "target", &val) == 0) {
if (val != target)
continue;
- hit++;
+ wired++;
}
if (resource_int_value(dname, dunit, "lun", &val) == 0) {
if (val != lun)
continue;
- hit++;
+ wired++;
}
- if (hit != 0) {
+ if (wired != 0) {
unit = dunit;
break;
}
@@ -402,8 +401,7 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid,
* if we have wildcard matches, we don't return the same
* unit number twice.
*/
- unit = camperiphnextunit(p_drv, unit, /*wired*/hit, pathid,
- target, lun);
+ unit = camperiphnextunit(p_drv, unit, wired, pathid, target, lun);
return (unit);
}