Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750882AbaLOSvM (ORCPT ); Mon, 15 Dec 2014 13:51:12 -0500 Received: from mail-pd0-f172.google.com ([209.85.192.172]:32983 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbaLOSvI (ORCPT ); Mon, 15 Dec 2014 13:51:08 -0500 Date: Mon, 15 Dec 2014 10:51:04 -0800 From: Jeremiah Mahler To: Andy Whitcroft Cc: KY Srinivasan , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "jasowang@redhat.com" , "mcb30@ipxe.org" Subject: Re: [PATCH V3 1/1] Drivers: hv: vmbus: Fix a bug in vmbus_establish_gpadl() Message-ID: <20141215185104.GA25345@hudson.localdomain> Mail-Followup-To: Jeremiah Mahler , Andy Whitcroft , KY Srinivasan , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "jasowang@redhat.com" , "mcb30@ipxe.org" References: <1418260380-8774-1-git-send-email-kys@microsoft.com> <20141211021019.GA5648@hudson.localdomain> <20141215075919.GA12088@newt.localdomain> <20141215154704.GA5259@bark> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141215154704.GA5259@bark> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 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/