From 642f0c46bf91551aa00537d63e4f26f75be06d42 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sun, 15 Oct 2000 10:17:55 +0000 Subject: [PATCH] Slight cleanup - this is logically equivalent code but means one less use of the evil resource_locate() function. --- sys/cam/cam_xpt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index bf23cbc60742..33d02aa41320 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4164,19 +4164,19 @@ xptpathid(const char *sim_name, int sim_unit, int sim_bus) { path_id_t pathid; int i, dunit, val; - char buf[32], *strval; + char buf[32]; pathid = CAM_XPT_PATH_ID; snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); i = -1; - while ((i = resource_locate(i, "scbus")) != -1) { + while ((i = resource_query_string(i, "at", buf)) != -1) { + if (strcmp(resource_query_name(i), "scbus")) { + /* Avoid a bit of foot shooting. */ + continue; + } dunit = resource_query_unit(i); if (dunit < 0) /* unwired?! */ continue; - if (resource_string_value("scbus", dunit, "at", &strval) != 0) - continue; - if (strcmp(buf, strval) != 0) - continue; if (resource_int_value("scbus", dunit, "bus", &val) == 0) { if (sim_bus == val) { pathid = dunit;