[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 08/12] x86/hvm/ioreq: maintain an array of ioreq servers rather than a list



>>> On 04.09.17 at 15:40, <roger.pau@xxxxxxxxxx> wrote:
> On Thu, Aug 31, 2017 at 10:36:01AM +0100, Paul Durrant wrote:
>>  void hvm_destroy_all_ioreq_servers(struct domain *d)
>>  {
>> -    struct hvm_ioreq_server *s, *next;
>> +    unsigned int id;
>>  
>>      spin_lock_recursive(&d->arch.hvm_domain.ioreq_server.lock);
>>  
>>      /* No need to domain_pause() as the domain is being torn down */
>>  
>> -    list_for_each_entry_safe ( s,
>> -                               next,
>> -                               &d->arch.hvm_domain.ioreq_server.list,
>> -                               list_entry )
>> +    for ( id = 0; id < MAX_NR_IOREQ_SERVERS; id++ )
>>      {
>> -        bool is_default = (s == d->arch.hvm_domain.default_ioreq_server);
>> +        struct hvm_ioreq_server *s;
>>  
>> -        hvm_ioreq_server_disable(s, is_default);
>> +        s = d->arch.hvm_domain.ioreq_server.server[id];
>>  
>> -        if ( is_default )
>> -            d->arch.hvm_domain.default_ioreq_server = NULL;
>> +        if ( !s )
>> +            continue;
>>  
>> -        list_del(&s->list_entry);
>> +        hvm_ioreq_server_disable(s);
>> +        hvm_ioreq_server_deinit(s);
>>  
>> -        hvm_ioreq_server_deinit(s, is_default);
>> +        ASSERT(d->arch.hvm_domain.ioreq_server.count);
>> +        --d->arch.hvm_domain.ioreq_server.count;
> 
> It seems more common to use d->arch.hvm_domain.ioreq_server.count--,
> unless there' a reason for prefixing the decrement.

At least for people also writing C++ code every now and then it is
certainly more natural to use the prefixing operator.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.