[Linux1394-cvslog] rev 832 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-03-10 20:34:50
|
Author: bencollins Date: 2003-03-10 15:34:07 -0500 (Mon, 10 Mar 2003) New Revision: 832 Modified: trunk/highlevel.c Log: The highlevel ops should not force an add_host callback. So check for it. Modified: trunk/highlevel.c ============================================================================== --- trunk/highlevel.c (original) +++ trunk/highlevel.c 2003-03-10 15:34:08.000000000 -0500 @@ -57,7 +57,8 @@ list_add_tail(&hl->hl_list, &hl_drivers); up(&hl_drivers_lock); - hl_all_hosts(hl->op->add_host); + if (hl->op->add_host) + hl_all_hosts(hl->op->add_host); return hl; } @@ -202,7 +203,8 @@ list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); - hl->op->add_host(host); + if (hl->op->add_host) + hl->op->add_host(host); } up(&hl_drivers_lock); } @@ -245,14 +247,11 @@ int channel = (data[0] >> 8) & 0x3f; down(&hl_drivers_lock); - entry = hl_drivers.next; - - while (entry != &hl_drivers) { + list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); - if (hl->op->iso_receive) { + + if (hl->op->iso_receive) hl->op->iso_receive(host, channel, data, length); - } - entry = entry->next; } up(&hl_drivers_lock); } @@ -265,15 +264,10 @@ int cts = data[0] >> 4; down(&hl_drivers_lock); - entry = hl_drivers.next; - - while (entry != &hl_drivers) { + list_for_each(entry, &hl_drivers) { hl = list_entry(entry, struct hpsb_highlevel, hl_list); - if (hl->op->fcp_request) { - hl->op->fcp_request(host, nodeid, direction, cts, data, - length); - } - entry = entry->next; + if (hl->op->fcp_request) + hl->op->fcp_request(host, nodeid, direction, cts, data, length); } up(&hl_drivers_lock); } @@ -295,7 +289,7 @@ if (as->end > addr) { partlength = min(as->end - addr, (u64) length); - if (as->op->read != NULL) { + if (as->op->read) { rcode = as->op->read(host, nodeid, buffer, addr, partlength, flags); } else { @@ -340,7 +334,7 @@ if (as->end > addr) { partlength = min(as->end - addr, (u64) length); - if (as->op->write != NULL) { + if (as->op->write) { rcode = as->op->write(host, nodeid, destid, data, addr, partlength, flags); } else { @@ -383,7 +377,7 @@ while (as->start <= addr) { if (as->end > addr) { - if (as->op->lock != NULL) { + if (as->op->lock) { rcode = as->op->lock(host, nodeid, store, addr, data, arg, ext_tcode, flags); } else { @@ -416,7 +410,7 @@ while (as->start <= addr) { if (as->end > addr) { - if (as->op->lock64 != NULL) { + if (as->op->lock64) { rcode = as->op->lock64(host, nodeid, store, addr, data, arg, ext_tcode, flags); |