1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Slight cleanup - this is logically equivalent code but means one less

use of the evil resource_locate() function.
This commit is contained in:
Peter Wemm 2000-10-15 10:17:55 +00:00
parent 398bc678aa
commit 642f0c46bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67159

View File

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