Commit c486d30d authored by Ben Collins's avatar Ben Collins

IEEE1394(r1130): Conversion of some list_for_each() usages to list_for_each_entry().

parent 26abb0a1
......@@ -862,14 +862,14 @@ static int stream_alloc_packet_lists(struct stream *s)
static void stream_free_packet_lists(struct stream *s)
{
struct list_head *lh, *next;
struct packet_list *packet_l, *packet_l_next;
if (s->current_packet_list != NULL)
packet_list_free(s->current_packet_list, s);
list_for_each_safe(lh, next, &s->dma_packet_lists)
packet_list_free(list_entry(lh, struct packet_list, link), s);
list_for_each_safe(lh, next, &s->free_packet_lists)
packet_list_free(list_entry(lh, struct packet_list, link), s);
list_for_each_entry_safe(packet_l, packet_l_next, &s->dma_packet_lists, link)
packet_list_free(packet_l, s);
list_for_each_entry_safe(packet_l, packet_l_next, &s->free_packet_lists, link)
packet_list_free(packet_l, s);
if (s->packet_pool != NULL)
pci_pool_destroy(s->packet_pool);
......
......@@ -1801,15 +1801,12 @@ static int dv1394_open(struct inode *inode, struct file *file)
} else {
/* look up the card by ID */
struct list_head *lh;
unsigned long flags;
spin_lock_irqsave(&dv1394_cards_lock, flags);
if (!list_empty(&dv1394_cards)) {
struct video_card *p;
list_for_each(lh, &dv1394_cards) {
p = list_entry(lh, struct video_card, list);
list_for_each_entry(p, &dv1394_cards, list) {
if ((p->id) == ieee1394_file_to_instance(file)) {
video = p;
break;
......@@ -2374,7 +2371,6 @@ static void dv1394_host_reset(struct hpsb_host *host)
struct ti_ohci *ohci;
struct video_card *video = NULL;
unsigned long flags;
struct list_head *lh;
/* We only work with the OHCI-1394 driver */
if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME))
......@@ -2386,8 +2382,7 @@ static void dv1394_host_reset(struct hpsb_host *host)
/* find the corresponding video_cards */
spin_lock_irqsave(&dv1394_cards_lock, flags);
if (!list_empty(&dv1394_cards)) {
list_for_each(lh, &dv1394_cards) {
video = list_entry(lh, struct video_card, list);
list_for_each_entry(video, &dv1394_cards, list) {
if ((video->id >> 2) == ohci->id)
break;
}
......
......@@ -946,12 +946,9 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
static inline int fragment_overlap(struct list_head *frag_list, int offset, int len)
{
struct list_head *lh;
struct fragment_info *fi;
list_for_each(lh, frag_list) {
fi = list_entry(lh, struct fragment_info, list);
list_for_each_entry(fi, frag_list, list) {
if ( ! ((offset > (fi->offset + fi->len - 1)) ||
((offset + len - 1) < fi->offset)))
return 1;
......@@ -961,13 +958,11 @@ static inline int fragment_overlap(struct list_head *frag_list, int offset, int
static inline struct list_head *find_partial_datagram(struct list_head *pdgl, int dgl)
{
struct list_head *lh;
struct partial_datagram *pd;
list_for_each(lh, pdgl) {
pd = list_entry(lh, struct partial_datagram, list);
list_for_each_entry(pd, pdgl, list) {
if (pd->dgl == dgl)
return lh;
return &pd->list;
}
return NULL;
}
......
......@@ -56,14 +56,12 @@ static struct hl_host_info *hl_get_hostinfo(struct hpsb_highlevel *hl,
struct hpsb_host *host)
{
struct hl_host_info *hi = NULL;
struct list_head *lh;
if (!hl || !host)
return NULL;
read_lock(&hl->host_info_lock);
list_for_each (lh, &hl->host_info_list) {
hi = list_entry(lh, struct hl_host_info, list);
list_for_each_entry(hi, &hl->host_info_list, list) {
if (hi->host == host)
break;
hi = NULL;
......@@ -188,7 +186,6 @@ unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host
void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
{
struct list_head *lh;
struct hl_host_info *hi;
void *data = NULL;
......@@ -196,8 +193,7 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
return NULL;
read_lock(&hl->host_info_lock);
list_for_each (lh, &hl->host_info_list) {
hi = list_entry(lh, struct hl_host_info, list);
list_for_each_entry(hi, &hl->host_info_list, list) {
if (hi->key == key) {
data = hi->data;
break;
......@@ -211,7 +207,6 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key)
struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long key)
{
struct list_head *lh;
struct hl_host_info *hi;
struct hpsb_host *host = NULL;
......@@ -219,8 +214,7 @@ struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long k
return NULL;
read_lock(&hl->host_info_lock);
list_for_each (lh, &hl->host_info_list) {
hi = list_entry(lh, struct hl_host_info, list);
list_for_each_entry(hi, &hl->host_info_list, list) {
if (hi->key == key) {
host = hi->host;
break;
......
......@@ -935,8 +935,7 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
void abort_requests(struct hpsb_host *host)
{
unsigned long flags;
struct hpsb_packet *packet;
struct list_head *lh, *tlh;
struct hpsb_packet *packet, *packet_next;
LIST_HEAD(llist);
host->driver->devctl(host, CANCEL_REQUESTS, 0);
......@@ -946,8 +945,7 @@ void abort_requests(struct hpsb_host *host)
INIT_LIST_HEAD(&host->pending_packets);
spin_unlock_irqrestore(&host->pending_pkt_lock, flags);
list_for_each_safe(lh, tlh, &llist) {
packet = list_entry(lh, struct hpsb_packet, list);
list_for_each_entry_safe(packet, packet_next, &llist, list) {
list_del(&packet->list);
packet->state = hpsb_complete;
packet->ack_code = ACKX_ABORTED;
......@@ -959,9 +957,8 @@ void abort_timedouts(unsigned long __opaque)
{
struct hpsb_host *host = (struct hpsb_host *)__opaque;
unsigned long flags;
struct hpsb_packet *packet;
struct hpsb_packet *packet, *packet_next;
unsigned long expire;
struct list_head *lh, *tlh;
LIST_HEAD(expiredlist);
spin_lock_irqsave(&host->csr.lock, flags);
......@@ -970,8 +967,7 @@ void abort_timedouts(unsigned long __opaque)
spin_lock_irqsave(&host->pending_pkt_lock, flags);
list_for_each_safe(lh, tlh, &host->pending_packets) {
packet = list_entry(lh, struct hpsb_packet, list);
list_for_each_entry_safe(packet, packet_next, &host->pending_packets, list) {
if (time_before(packet->sendtime + expire, jiffies)) {
list_del(&packet->list);
list_add(&packet->list, &expiredlist);
......@@ -983,8 +979,7 @@ void abort_timedouts(unsigned long __opaque)
spin_unlock_irqrestore(&host->pending_pkt_lock, flags);
list_for_each_safe(lh, tlh, &expiredlist) {
packet = list_entry(lh, struct hpsb_packet, list);
list_for_each_entry_safe(packet, packet_next, &expiredlist, list) {
list_del(&packet->list);
packet->state = hpsb_complete;
packet->ack_code = ACKX_TIMEOUT;
......
......@@ -2207,14 +2207,12 @@ static void ohci_schedule_iso_tasklets(struct ti_ohci *ohci,
quadlet_t rx_event,
quadlet_t tx_event)
{
struct list_head *lh;
struct ohci1394_iso_tasklet *t;
unsigned long mask;
spin_lock(&ohci->iso_tasklet_list_lock);
list_for_each(lh, &ohci->iso_tasklet_list) {
t = list_entry(lh, struct ohci1394_iso_tasklet, link);
list_for_each_entry(t, &ohci->iso_tasklet_list, link) {
mask = 1 << t->context;
if (t->type == OHCI_ISO_TRANSMIT && tx_event & mask)
......
......@@ -215,15 +215,11 @@ static void add_host(struct hpsb_host *host)
static struct host_info *find_host_info(struct hpsb_host *host)
{
struct list_head *lh;
struct host_info *hi;
list_for_each(lh, &host_info_list) {
hi = list_entry(lh, struct host_info, list);
if (hi->host == host) {
list_for_each_entry(hi, &host_info_list, list)
if (hi->host == host)
return hi;
}
}
return NULL;
}
......@@ -262,7 +258,6 @@ static void remove_host(struct hpsb_host *host)
static void host_reset(struct hpsb_host *host)
{
unsigned long flags;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi;
struct pending_request *req;
......@@ -271,8 +266,7 @@ static void host_reset(struct hpsb_host *host)
hi = find_host_info(host);
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
if (fi->notification == RAW1394_NOTIFY_ON) {
req = __alloc_pending_request(SLAB_ATOMIC);
......@@ -299,7 +293,6 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
size_t length)
{
unsigned long flags;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi;
struct pending_request *req;
......@@ -315,12 +308,9 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
hi = find_host_info(host);
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
if (!(fi->listen_channels & (1ULL << channel))) {
list_for_each_entry(fi, &hi->file_info_list, list) {
if (!(fi->listen_channels & (1ULL << channel)))
continue;
}
req = __alloc_pending_request(SLAB_ATOMIC);
if (!req) break;
......@@ -355,20 +345,14 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data,
}
spin_unlock_irqrestore(&host_info_lock, flags);
lh = reqs.next;
while (lh != &reqs) {
req = list_entry(lh, struct pending_request, list);
lh = lh->next;
list_for_each_entry(req, &reqs, list)
queue_complete_req(req);
}
}
static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
int cts, u8 *data, size_t length)
{
unsigned long flags;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi;
struct pending_request *req;
......@@ -384,12 +368,9 @@ static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
hi = find_host_info(host);
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
if (!fi->fcp_buffer) {
list_for_each_entry(fi, &hi->file_info_list, list) {
if (!fi->fcp_buffer)
continue;
}
req = __alloc_pending_request(SLAB_ATOMIC);
if (!req) break;
......@@ -424,13 +405,8 @@ static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
}
spin_unlock_irqrestore(&host_info_lock, flags);
lh = reqs.next;
while (lh != &reqs) {
req = list_entry(lh, struct pending_request, list);
lh = lh->next;
list_for_each_entry(req, &reqs, list)
queue_complete_req(req);
}
}
......@@ -506,7 +482,6 @@ static int state_opened(struct file_info *fi, struct pending_request *req)
static int state_initialized(struct file_info *fi, struct pending_request *req)
{
struct list_head *lh;
struct host_info *hi;
struct raw1394_khost_list *khl;
......@@ -528,12 +503,9 @@ static int state_initialized(struct file_info *fi, struct pending_request *req)
req->req.misc = host_count;
req->data = (quadlet_t *)khl;
list_for_each(lh, &host_info_list) {
hi = list_entry(lh, struct host_info, list);
list_for_each_entry(hi, &host_info_list, list) {
khl->nodes = hi->host->node_count;
strcpy(khl->name, hi->host->driver->name);
khl++;
}
}
......@@ -551,23 +523,17 @@ static int state_initialized(struct file_info *fi, struct pending_request *req)
break;
case RAW1394_REQ_SET_CARD:
lh = NULL;
spin_lock_irq(&host_info_lock);
if (req->req.misc < host_count) {
lh = host_info_list.next;
while (req->req.misc--) {
lh = lh->next;
}
hi = list_entry(lh, struct host_info, list);
list_for_each_entry(hi, &host_info_list, list) {
if (!req->req.misc--)
break;
}
get_device(&hi->host->device); // XXX Need to handle failure case
list_add_tail(&fi->list, &hi->file_info_list);
fi->host = hi->host;
fi->state = connected;
}
spin_unlock_irq(&host_info_lock);
if (lh != NULL) {
req->req.error = RAW1394_ERROR_NONE;
req->req.generation = get_hpsb_generation(fi->host);
req->req.misc = (fi->host->node_id << 16)
......@@ -578,6 +544,7 @@ static int state_initialized(struct file_info *fi, struct pending_request *req)
} else {
req->req.error = RAW1394_ERROR_INVALID_ARG;
}
spin_unlock_irq(&host_info_lock);
req->req.length = 0;
break;
......@@ -899,7 +866,6 @@ static int arm_read (struct hpsb_host *host, int nodeid, quadlet_t *buffer,
u64 addr, size_t length, u16 flags)
{
struct pending_request *req;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi = NULL;
struct list_head *entry;
......@@ -916,8 +882,7 @@ static int arm_read (struct hpsb_host *host, int nodeid, quadlet_t *buffer,
spin_lock(&host_info_lock);
hi = find_host_info(host); /* search address-entry */
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
entry = fi->addr_list.next;
while (entry != &(fi->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1035,7 +1000,6 @@ static int arm_write (struct hpsb_host *host, int nodeid, int destid,
quadlet_t *data, u64 addr, size_t length, u16 flags)
{
struct pending_request *req;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi = NULL;
struct list_head *entry;
......@@ -1052,8 +1016,7 @@ static int arm_write (struct hpsb_host *host, int nodeid, int destid,
spin_lock(&host_info_lock);
hi = find_host_info(host); /* search address-entry */
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
entry = fi->addr_list.next;
while (entry != &(fi->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1162,7 +1125,6 @@ static int arm_lock (struct hpsb_host *host, int nodeid, quadlet_t *store,
u64 addr, quadlet_t data, quadlet_t arg, int ext_tcode, u16 flags)
{
struct pending_request *req;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi = NULL;
struct list_head *entry;
......@@ -1188,8 +1150,7 @@ static int arm_lock (struct hpsb_host *host, int nodeid, quadlet_t *store,
spin_lock(&host_info_lock);
hi = find_host_info(host); /* search address-entry */
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
entry = fi->addr_list.next;
while (entry != &(fi->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1360,7 +1321,6 @@ static int arm_lock64 (struct hpsb_host *host, int nodeid, octlet_t *store,
u64 addr, octlet_t data, octlet_t arg, int ext_tcode, u16 flags)
{
struct pending_request *req;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi = NULL;
struct list_head *entry;
......@@ -1395,8 +1355,7 @@ static int arm_lock64 (struct hpsb_host *host, int nodeid, octlet_t *store,
spin_lock(&host_info_lock);
hi = find_host_info(host); /* search addressentry in file_info's for host */
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
entry = fi->addr_list.next;
while (entry != &(fi->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1567,7 +1526,6 @@ static int arm_register(struct file_info *fi, struct pending_request *req)
{
int retval;
struct arm_addr *addr;
struct list_head *lh, *lh_1, *lh_2;
struct host_info *hi;
struct file_info *fi_hlp = NULL;
struct list_head *entry;
......@@ -1631,8 +1589,7 @@ static int arm_register(struct file_info *fi, struct pending_request *req)
same_host = 0;
another_host = 0;
/* same host with address-entry containing same addressrange ? */
list_for_each(lh, &hi->file_info_list) {
fi_hlp = list_entry(lh, struct file_info, list);
list_for_each_entry(fi_hlp, &hi->file_info_list, list) {
entry = fi_hlp->addr_list.next;
while (entry != &(fi_hlp->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1657,11 +1614,9 @@ static int arm_register(struct file_info *fi, struct pending_request *req)
return (-EALREADY);
}
/* another host with valid address-entry containing same addressrange */
list_for_each(lh_1, &host_info_list) {
hi = list_entry(lh_1, struct host_info, list);
list_for_each_entry(hi, &host_info_list, list) {
if (hi->host != fi->host) {
list_for_each(lh_2, &hi->file_info_list) {
fi_hlp = list_entry(lh_2, struct file_info, list);
list_for_each_entry(fi_hlp, &hi->file_info_list, list) {
entry = fi_hlp->addr_list.next;
while (entry != &(fi_hlp->addr_list)) {
arm_addr = list_entry(entry, struct arm_addr, addr_list);
......@@ -1720,7 +1675,6 @@ static int arm_unregister(struct file_info *fi, struct pending_request *req)
int retval = 0;
struct list_head *entry;
struct arm_addr *addr = NULL;
struct list_head *lh_1, *lh_2;
struct host_info *hi;
struct file_info *fi_hlp = NULL;
struct arm_addr *arm_addr = NULL;
......@@ -1751,11 +1705,9 @@ static int arm_unregister(struct file_info *fi, struct pending_request *req)
another_host = 0;
/* another host with valid address-entry containing
same addressrange */
list_for_each(lh_1, &host_info_list) {
hi = list_entry(lh_1, struct host_info, list);
list_for_each_entry(hi, &host_info_list, list) {
if (hi->host != fi->host) {
list_for_each(lh_2, &hi->file_info_list) {
fi_hlp = list_entry(lh_2, struct file_info, list);
list_for_each_entry(fi_hlp, &hi->file_info_list, list) {
entry = fi_hlp->addr_list.next;
while (entry != &(fi_hlp->addr_list)) {
arm_addr = list_entry(entry,
......@@ -2244,15 +2196,11 @@ static ssize_t raw1394_write(struct file *file, const char *buffer, size_t count
* completion queue (reqlists_lock must be taken) */
static inline int __rawiso_event_in_queue(struct file_info *fi)
{
struct list_head *lh;
struct pending_request *req;
list_for_each(lh, &fi->req_complete) {
req = list_entry(lh, struct pending_request, list);
if (req->req.type == RAW1394_REQ_RAWISO_ACTIVITY) {
list_for_each_entry(req, &fi->req_complete, list)
if (req->req.type == RAW1394_REQ_RAWISO_ACTIVITY)
return 1;
}
}
return 0;
}
......@@ -2286,15 +2234,14 @@ static void queue_rawiso_event(struct file_info *fi)
static void rawiso_activity_cb(struct hpsb_iso *iso)
{
unsigned long flags;
struct list_head *lh;
struct host_info *hi;
struct file_info *fi;
spin_lock_irqsave(&host_info_lock, flags);
hi = find_host_info(iso->host);
if (hi != NULL) {
list_for_each(lh, &hi->file_info_list) {
struct file_info *fi = list_entry(lh, struct file_info, list);
list_for_each_entry(fi, &hi->file_info_list, list) {
if (fi->iso_handle == iso)
queue_rawiso_event(fi);
}
......@@ -2614,7 +2561,6 @@ static int raw1394_release(struct inode *inode, struct file *file)
int retval = 0;
struct list_head *entry;
struct arm_addr *addr = NULL;
struct list_head *lh_1, *lh_2;
struct host_info *hi;
struct file_info *fi_hlp = NULL;
struct arm_addr *arm_addr = NULL;
......@@ -2644,11 +2590,9 @@ static int raw1394_release(struct inode *inode, struct file *file)
addr = list_entry(lh, struct arm_addr, addr_list);
/* another host with valid address-entry containing
same addressrange? */
list_for_each(lh_1, &host_info_list) {
hi = list_entry(lh_1, struct host_info, list);
list_for_each_entry(hi, &host_info_list, list) {
if (hi->host != fi->host) {
list_for_each(lh_2, &hi->file_info_list) {
fi_hlp = list_entry(lh_2, struct file_info, list);
list_for_each_entry(fi_hlp, &hi->file_info_list, list) {
entry = fi_hlp->addr_list.next;
while (entry != &(fi_hlp->addr_list)) {
arm_addr = list_entry(entry,
......
......@@ -470,14 +470,12 @@ static void sbp2util_remove_command_orb_pool(struct scsi_id_instance_data *scsi_
static struct sbp2_command_info *sbp2util_find_command_for_orb(
struct scsi_id_instance_data *scsi_id, dma_addr_t orb)
{
struct list_head *lh;
struct sbp2_command_info *command;
unsigned long flags;
spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
if (!list_empty(&scsi_id->sbp2_command_orb_inuse)) {
list_for_each(lh, &scsi_id->sbp2_command_orb_inuse) {
command = list_entry(lh, struct sbp2_command_info, list);
list_for_each_entry(command, &scsi_id->sbp2_command_orb_inuse, list) {
if (command->command_orb_dma == orb) {
spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags);
return (command);
......@@ -497,14 +495,12 @@ static struct sbp2_command_info *sbp2util_find_command_for_orb(
*/
static struct sbp2_command_info *sbp2util_find_command_for_SCpnt(struct scsi_id_instance_data *scsi_id, void *SCpnt)
{
struct list_head *lh;
struct sbp2_command_info *command;
unsigned long flags;
spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
if (!list_empty(&scsi_id->sbp2_command_orb_inuse)) {
list_for_each(lh, &scsi_id->sbp2_command_orb_inuse) {
command = list_entry(lh, struct sbp2_command_info, list);
list_for_each_entry(command, &scsi_id->sbp2_command_orb_inuse, list) {
if (command->Current_SCpnt == SCpnt) {
spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags);
return (command);
......@@ -1563,7 +1559,6 @@ static void sbp2_parse_unit_directory(struct scsi_id_group *scsi_group,
struct csr1212_keyval *kv;
struct csr1212_dentry *dentry;
struct scsi_id_instance_data *scsi_id;
struct list_head *lh;
u64 management_agent_addr;
u32 command_set_spec_id, command_set, unit_characteristics,
firmware_revision, workarounds;
......@@ -1706,9 +1701,7 @@ static void sbp2_parse_unit_directory(struct scsi_id_group *scsi_group,
}
/* Update the generic fields in all the LUN's */
list_for_each (lh, &scsi_group->scsi_id_list) {
scsi_id = list_entry(lh, struct scsi_id_instance_data, list);
list_for_each_entry(scsi_id, &scsi_group->scsi_id_list, list) {
scsi_id->sbp2_management_agent_addr = management_agent_addr;
scsi_id->sbp2_command_set_spec_id = command_set_spec_id;
scsi_id->sbp2_command_set = command_set;
......
......@@ -476,11 +476,9 @@ static void initialize_dma_ir_ctx(struct dma_iso_ctx *d, int tag, int flags)
static struct dma_iso_ctx *
find_ctx(struct list_head *list, int type, int channel)
{
struct list_head *lh;
struct dma_iso_ctx *ctx;
list_for_each(lh, list) {
struct dma_iso_ctx *ctx;
ctx = list_entry(lh, struct dma_iso_ctx, link);
list_for_each_entry(ctx, list, link) {
if (ctx->type == type && ctx->channel == channel)
return ctx;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment