lkml.org 
[lkml]   [2005]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH 3/6] PCI Express Advanced Error Reporting Driver
Date
From
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.304 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site