RE: [PATCH 3/6] PCI Express Advanced Error Reporting Driver

From: Nguyen, Tom L
Date: Mon Mar 14 2005 - 11:50:21 EST


On Friday, March 11, 2005 11:28 PM Greg KH wrote:
>> +
>> +LIST_HEAD(evt_queue); /* Define Event Queue
List */
>
>Make this static?

Agree, will make this static. Good comment! Thanks.


>> +
>> +/**
>> + * evt_queue_pop - restore an event node from an event log list
>> + * @where: either from top or bottom of a list
>> + *
>> + * Invoked when an error being consumed
>> + **/
>> +static struct event_node* evt_queue_pop(int where)
>> +{
>> + struct list_head *head = &evt_queue;
>> + struct event_node *evt_node = NULL;
>> +
>> + if (!list_empty(head)) {
>> + head = ((where == GET_ERR_RECORD_TOP) ? head->prev :
head->>next);
>> + evt_node = container_of(head, struct event_node,
e_node);
>> + list_del(&evt_node->e_node);
>> + records--;
>> + }
>> +
>> + return evt_node;
>> +}
>
>The lock is not held in the pop, like it is in the push function. Any
>reason for this?

The lock is held by its caller, consume_record. I can add a comment at
this function to make it clear.

Thanks,
Long
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/