Slight cleanup - this is logically equivalent code but means one less
use of the evil resource_locate() function.
This commit is contained in:
parent
398bc678aa
commit
642f0c46bf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user