Re: [PATCH V3 1/1] Drivers: hv: vmbus: Fix a bug in vmbus_establish_gpadl()

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

 



Andy,

On Mon, Dec 15, 2014 at 03:47:04PM +0000, Andy Whitcroft wrote:
> On Sun, Dec 14, 2014 at 11:59:19PM -0800, Jeremiah Mahler wrote:
[...]
> 
> The calculation appears identical to my reading, the original form was:
> 
>   next_gpadl_handle = atomic_read(&vmbus_connection.next_gpadl_handle);
>   atomic_inc(&vmbus_connection.next_gpadl_handle);
> 
> or:
> 
>   y = x;
>   x++;
> 
> so y == x' (x before incrementing)
> 
> the new code is:
> 
>   next_gpadl_handle = (atomic_inc_return(&vmbus_connection.next_gpadl_handle) - 1);
> 
> or:
> 
>   y = ++x - 1;
> 
> Also making y = x' (x before incrementing)
> 
> -apw

Ah, you are right.  The increment before/after messed me up.

Thanks for clearing that up for me :-)

-- 
- Jeremiah Mahler
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux