lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Jun 2009 07:46:15 -0400
From:	Gregory Haskins <ghaskins@...ell.com>
To:	Avi Kivity <avi@...hat.com>
CC:	kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
	davidel@...ilserver.org, mtosatti@...hat.com,
	paulmck@...ux.vnet.ibm.com, markmc@...hat.com
Subject: Re: [KVM PATCH v7 1/2] KVM: make io_bus interface more robust

Avi Kivity wrote:
> On 06/16/2009 04:42 PM, Gregory Haskins wrote:
>> +
>> +/* assumes kvm->lock held */
>> +void kvm_io_bus_unregister_dev(struct kvm_io_bus *bus,
>> +                   struct kvm_io_device *dev)
>> +{
>> +    int i;
>> +
>> +    for (i = 0; i<  bus->dev_count; i++) {
>> +
>> +        if (bus->devs[i] == dev) {
>> +            int j;
>> +
>> +            /* backfill the hole */
>> +            for (j = i; j<  bus->dev_count-1; j++)
>> +                bus->devs[j] = bus->devs[j+1];
>> +
>> +            bus->dev_count--;
>> +
>> +            break;
>>    
>
> Could be simplified to
>
>     if (bus->devs[i] == dev) {
>         bus->devs[i] = bus->devs[--bus->dev_count];
>         return;
>     }
>
Clever!

Will do.

-Greg


Download attachment "signature.asc" of type "application/pgp-signature" (267 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ